Hey so i need some help with a execute command, im trying to get it so when a player walks on a certain block it does a bunch of commands, i need to do this multiple times so dont worry about the run command bit, so far i got Execute if entity @a[x=9,y=23,z=14] This does not work plz help
5
One or more block types? Because then it would make sense to set up a block tag and then check for that tag. As to running multiple commands: functions are your friend.
You could also run it with a command that targets them if they stand on a particular block, with a repeater that needs redstone, here:
/execute at @a if block ~ ~-1 ~ minecraft:[BLOCK] run [COMMAND]
/execute at @a if block ~ ~-1 ~ minecraft:[BLOCK] run [COMMAND]
redstone in big maps and servers tend to fail. It is best not used when you have the power of commands anyways
You'll need the distance selector along with those coordinates. Leaving them without it will make the game unsure of where exactly to target. So here's what you should do:
/execute if entity @a[x=9,y=23,z=14,distance=..1]
/execute if entity @a[x=9,y=23,z=14,distance=..1]
Note that the distance selector is very iffy.
distance=..1 means the exact position the block is in. So if the selector is x=23 and you're in x=23.5, it wont detect
distance=..2 is the optimal place as it detects anywhere inside that block.
distance=..3 is 1 block from the target block and so on
distance=..1 means the exact position the block is in. So if the selector is x=23 and you're in x=23.5, it wont detect
distance=..2 is the optimal place as it detects anywhere inside that block.
distance=..3 is 1 block from the target block and so on
