Minecraft:Commands/agent: Difference between revisions
From SAS Gaming Wiki
More actions
imported>RedX No edit summary |
Fix template calls: add MC/ prefix |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{MC/Exclusive|bedrock|education}} | ||
{{Infobox command | {{Infobox command | ||
|oplevel= | |oplevel= | ||
| Line 7: | Line 7: | ||
'''/agent''' is a command used to control an [[Minecraft:agent]]. | '''/agent''' is a command used to control an [[Minecraft: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 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 {{MC/Cmd|agent|link=none}} command can be run using an NPC. | ||
If a player summons an agent using an NPC then the only way to remove it from their world is by using an NBT Editor and deleting the <code>actorprefix</code> file for that agent. | If a player summons an agent using an NPC then the only way to remove it from their world is by using an NBT Editor and deleting the <code>actorprefix</code> file for that agent. | ||
| Line 46: | Line 46: | ||
::: Makes an agent place a block in a specified direction. | ::: Makes an agent place a block in a specified direction. | ||
:* <code>… setitem <int:slotNum> <int:quantity> <int:amount> <int:data></code> | :* <code>… setitem <int:slotNum> <int:quantity> <int:amount> <int:data></code> | ||
::: {{ | ::: {{MC/Info needed}} | ||
:* <code>… getitemcount <int:slotNum></code> | :* <code>… getitemcount <int:slotNum></code> | ||
::: 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. | ::: 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. | ||
| Line 64: | Line 64: | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|pocket}} | |{{MC/HistoryLine|pocket}} | ||
|{{HistoryLine||1.0.0|dev=?|Added{{ | |{{HistoryLine||1.0.0|dev=?|Added{{MC/Cd|/agent}}.}} | ||
}} | }} | ||
=== ''Minecraft Education'' === | === ''Minecraft Education'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|education}} | |{{MC/HistoryLine|education}} | ||
|{{HistoryLine||?|Added{{ | |{{HistoryLine||?|Added{{MC/Cd|/agent}}.}} | ||
}} | }} | ||
| Line 78: | Line 78: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
ja:コマンド/agent | |||
pt:Comandos/agent | |||
zh:命令/agent | |||
Latest revision as of 20:08, 9 April 2026
Script error: No such module "Exclusive". Template:Infobox command
/agent is a command used to control an Minecraft: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
- REDIRECT Template:Command
Template:Redr command can be run using an NPC.
If a player summons an agent using an NPC then the only way to remove it from their world is by using an NBT Editor and deleting the actorprefix file for that agent.
Syntax
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
<direction>is one offorward|back|left|right|up|down
<turnDirection>is one ofleft|right
History
Bedrock Edition
Minecraft Education
See also
ja:コマンド/agent pt:Comandos/agent zh:命令/agent