The /execute
command is a versatile command used to execute commands on behalf of other entities, or to test for conditionals before executing a command. It offers multiple different parameters to set who, what, when, and where to execute the command.
There are two parameters that look very similar: at
and positioned as
.
The Minecraft Wiki has a clear description of what each one does: at
is used to position at an entity, while positioned
can be used to specify coordinates.
But however, there is another way to specify an entity: using positioned as ??
. This also offers us to specify an entity instead of coordinates to execute the command at.
What is the difference between these two parameters, and in which situations should I prefer each of them?
positioned as
includes orientation, i.e. where the target is looking./schedule
can do that directly and you can use ticking things or other things that have timings to make timers indirectly, based on conditions./execute positioned as
exists. I've never used it before, in my 192 Minecraft commands answers that use/mention/execute
or elsewhere. It's even confusingly named, because it's not like/execute as
at all.