/agent
< Commands
/agent
Permission level required |
|
---|---|
Restrictions |
None |
{ "title": "<code>/agent</code>", "rows": [ { "field": "\n* 0 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Minecraft Education\">(link to Minecraft Education article, displayed as Minecraft Education) only</span></i>]</sup>\n* 1 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as Bedrock Edition) only</span></i>]</sup>", "label": "(link to Permission level article, displayed as Permission level<br>required)" }, { "field": "None", "label": "(link to Commands#Restrictions article, displayed as Restrictions)" } ], "invimages": [], "images": [] }
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>
… 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 offorward|back|left|right|up|down
<turnDirection>
is one ofleft|right
History[edit | edit source]
[hide]Pocket Edition | |||||||
---|---|---|---|---|---|---|---|
1.0.0 | ? | Added/agent . | |||||
[hide]Minecraft Education | |||||||
? | Added/agent . |