Ok this might not be the best answer but I was thinking of running a command 20 ticks a second.
/execute @p ~ ~ ~ /fill ~7 ~7 ~7 ~-7 ~-7 ~-7 air 0 replace bedrock
This would work but it would also delete bedrock that the player has not placed i.e naturally spawned in bedrock.
Another method that I was thinking was to set the player in Gamemode 2 whenever he is holding bedrock in his hand, for example:
/testfor @p {SelectedItemSlot:(changable),Inventory:[{Slot:(changable)b,id:"minecraft:bedrock"}]}
Then make that flow into a command block that makes the player in adventure mode then a redstone torch that changes the player back into the original mode.
Hope it helped
As of 1.9, if a mob is the passenger of another mob, it will control the pathfinding of its host. For example, if you had a zombie riding an iron golem, the iron golem will chase the player due to the zombie targeting the player.
However, the iron golem will still attempt to attack enemy mobs. While normally you can circumvent this by adding both mobs to the same team, which is intended to prevent hostility between the two, this does not work with iron golems while an enemy is its passenger. Even setting the iron golem's generic.followRange
attribute to 0 will not prevent it from trying to attack the enemy mob riding it.
What you can use instead is a mob that the golem will not attack but will still target players, being a creeper. You can give the creeper a Fuse
value of 32767 to make it take roughly 27 minutes before it explodes, which resets if the player moves out of range, just to ensure it does not explode.
An example command that summons an iron golem being controlled by a creeper:
/summon VillagerGolem ~ ~1 ~ {Passengers:[{id:"Creeper",Silent:1b,Invulnerable:1b,Fuse:32767,ActiveEffects:[{Id:14,Duration:2147483647,ShowParticles:0b}]}]}
Unfortunately this type of control does not include attacking, so the golem will simply get as close to the player as possible while its rider attempts to attack (which, in this case, it cannot). You could try to simulate attacking by using the /effect
command around the golem:
/execute @e[type=VillagerGolem] ~ ~ ~ /effect @a[r=1] minecraft:instant_damage
Best Answer
When doing this you could use the possible commands:
(i'm not a full expert on the ride command but that command should solve your problem if this did not solve your problem please let me know) :)