I have been playing Minecraft for years and have an ok understanding of the command system inhabiting it. What troubles me the most recently revolves around the command initiator.

As we all know @s refers to the entity who called the command, otherwise known as the initiator. It appears to me that commands are most often issued by entities, and there are exceptions. One of the imminent examples is Command Block. Command Blocks are definitely not entities, but they can initiate commands at their own location, although they cannot be referred back to using @s.

Another thing is that when the game runs a data pack, I imagine that the lines of commands would be added to the gameplay loop. So is it that the system initiated the command? Can I /execute as the system? I know that scheduled commands are run by no entities therefore it presumably is run by the system. Finally, in a server, you can enter console commands outside the game. Are these commands all run by the system?

In general, is it that the commands initiated by server consoles, command blocks, or a data pack are executed directly by the system instead of any entities in the game?

1 Answer 1


This all ties into command context and how it's stored and applied across different use-cases.

Also important to note is that @s refers to the executing entity (not necessarily the initiator), so if there is none, the selector fails (e.g. when run from a commandblock without changing the executing entity through execute as).

What is command context?

All commands exist in a context.
This context is first set when the command is run and consists of multiple parts that all describe the "situation" that a command is run in.

  • the execution position (x / y / z and dimension)
  • the executing entity
  • the execution rotation
  • (the anchor)
    all of which can be modified individually with the 1.13+ Java as well as 1.19.1+ Bedrock execute command.

See the fandom wiki on the execute command for which subcommands modify which context.


When a command is run, it will get some default values depending on how it is run.

  • A command run from chat is executed as and at (so positioned and rotated as) the player who runs it.
  • A command run from a commandblock is executed with the position set to the center of the commandblock in all three axis. It is always rotated 0 0, so facing straight forward in south (positive z) direction. There is no executing entity.
  • A command run from a function can have various values, as functions themselves keep context. See below.

Context in Functions

Functions keep the context that they're run in.
So a function run in chat will have the same defaults as any other command run from a player in chat. The same is true for a function command run from a commandblock, it will have the same context as any command run from a commandblock would.
A command run from either the #minecraft:load or #minecraft:tick function tags will run positioned at world spawn (at the lowest end of the block, unlike the commandblock), rotated 0 0 and without an executing entity.


Running a command through the server console has the context as a function run from the built-in function tags: positioned at world spawn, rotated 0 0 and without an executing entity.

Source: https://www.reddit.com/r/MinecraftCommands/wiki/questions/commandcontext/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .