How to use vanilla commands

It is possible that inside your ExecutableBlocks you will use vanilla commands that needs a position, such as:

  • playsound..

  • summon..

  • particle..

  • effect..

  • etc

If its the case, let's explain you something, all commands in the commands section are run by the console, so when you type "summon zombie ~ ~ ~" that command will be run from "0,0,0" in the default world.

To avoid this you have to add "execute at %player% run" before the command, that will force the command to be run from the coordinates where the player is.

For example:

❌run summon tnt ~ ~ ~ 
✅execute at %player% run summon tnt ~ ~ ~

❌playsound minecraft:ambient.cave master %player% ~ ~ ~ 1 1
✅execute at %player% run playsound minecraft:ambient.cave master %player% ~ ~ ~ 1 1

❌particle minecraft:flame ~ ~ ~ 1 1 1 0 10
✅execute at %player% run particle minecraft:flame ~ ~ ~ 1 1 1 0 10

✅effect give %player% speed 15 1

✅execute at %player% run setblock ~ ~ ~ stone

✅execute at %player% run fill ~1 ~1 ~1 ~-1 ~-1 ~-1 stone replace air

✅execute at %player% run tellraw %player% {"text":"hi"}
✅execute at %player% run tellraw @a {"text":"hi"}

These are special exceptions, that means, placeholders or general stuff that only works by certain conditions.

execute at %player% run setblock %block_x% %block_y% %block_z% stone

execute at %player% run fill %block_x% %block_y% %block_z% %block_x% 255 %block_z% stone

execute in <<%block_world%>> positioned %block_x% %block_y% %block_z% run summon tnt ~ ~ ~

Discord

In case this didn't help you to achieve what you wanted or doesn't work for you, feel free to ask in the Discord of Ssomar plugins your question.

Last updated