1

Execute command

DanMcb's Avatar DanMcb9/22/19 3:30 pm
1 emeralds 145 5
9/27/2019 4:26 am
ShelLuser's Avatar ShelLuser
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
Posted by DanMcb's Avatar
DanMcb
Level 1 : New Miner
0

Create an account or sign in to comment.

5

1
09/27/2019 4:26 am
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
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.
1
09/22/2019 8:36 pm
Level 39 : Artisan Sailor
tomatotownn
tomatotownn's Avatar
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]
1
09/23/2019 2:38 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
redstone in big maps and servers tend to fail. It is best not used when you have the power of commands anyways
2
09/22/2019 4:52 pm
Level 21 : Expert Engineer
Thonck
Thonck's Avatar
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]
1
09/23/2019 2:41 amhistory
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome