/agent

Jump to navigation Jump to search
This feature is exclusive to Bedrock Edition and Minecraft Education.
 

/agent is a command used to control an agent. Agent control commands are only allowed to be executed by the WebSocket side to which the player is connected, and the player cannot execute the command directly in the game unless you use an NPC. The /agent command can be run using an NPC. WARNING: if you summon an agent using an NPC then the only way to remove it from your world is by using an NBT Editor and deleting the actorprefix file for that agent.

Syntax[edit | edit source]

agent . . .
  • … move <direction>
Moves an agent in a specified direction.
  • … turn <turnDirection>
Rotates an agent in a specified direction by 90 degrees.
  • … attack <direction>
Makes an agent attack in a specified direction.
  • … destroy <direction>
Makes an agent destroy a block or item in a specified direction.
  • … drop <int:slotNum> <int:quantity> <direction>
Makes an agent drop specified inventory slot numbered items in a specified quantity in a specified direction.
  • … dropall <direction>
Makes an agent drop all its items from all slots onto the ground by one block in a specified direction.
  • … inspect <direction>
Makes an agent return the name of the block in a specified direction.
  • … inspectdata <direction>
Makes an agent returns the data value of the block of a specified direction.
  • … detect <direction>
Makes an agent detect if there is a collidable block in a specified direction.
  • … detectredstone <direction>
Makes an agent detect a redstone signal of a specified direction.
  • … transfer <int:srcSlotNum> <int:quantity> <int:dstSlotNum>
Transfers a specified quantity of items from one slot to another of an agent's inventory.
  • … create
Creates an agent at the current player's position.
  • … tp <coordinates>
Teleports an agent to a specified position.
  • … collect <string:item>
Makes an agent collect all items within a one block from agent in three dimensions.
  • … till <direction>
Makes an agent till grass in a specified direction.
  • … place <int:slotNum> <direction>
Makes an agent place a block in a specified direction.
  • … setitem <int:slotNum> <int:quantity> <int:amount> <int:data>
[more information needed]
  • … getitemcount <int:slotNum>
Makes an agent return the number of items in a specified slot, as in how many the player could use before it would be empty.
  • … getitemspace <int:slotNum>
Makes an agent return the number of spaces remaining in a specified slot, as in the number of items you could add before it would be full.
  • … getitemdetail <int:slotNum>
Makes an agent return the name of the item in a specified slot.
  • … getposition
Makes an agent retrieve its position in the world.

Parameters[edit | edit source]

<direction> is one of forward|back|left|right|up|down
<turnDirection> is one of left|right

History[edit | edit source]

[hide]Pocket Edition
1.0.0?Added/agent.
[hide]Minecraft Education
?Added/agent.

See also[edit | edit source]

Navigation[edit | edit source]