Commands/detect
Minecraft Wiki article. Categories: Removed_features, Bedrock_Edition, Minecraft_Education, Unknown_Education_version_history, Commands
📌 Mirrored from Minecraft Wiki
This article is reproduced from Commands/detect on the Minecraft Wiki. Mirrored from revision 3271205. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.
On this page
This feature is exclusive to Bedrock Edition and Minecraft Education.
/detect{
"title": "<code>/detect</code>",
"rows": [
{
"field": "Hidden",
"label": "Visibility"
},
{
"field": "0",
"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": []
}
Lets your agent detect if there is a collidable block in the specified direction.
Syntax
detect <direction: string>
Arguments
direction: string
- Specifies the direction of Agent to detect a collidable block.
- Must be one of:
forwardto detect the block on the front.backto detect the block on the back.leftto detect the block on the left-hand side.rightto detect the block on the right-hand side.upto detect the block on the top side.downto detect the block on the bottom side.
Result
Fails if the arguments are not specified correctly.
On success, returns if there was a collidable block in the specified direction.
History
| Minecraft Education | |||||||
|---|---|---|---|---|---|---|---|
| ? | Added /detect. | ||||||
Navigation
Sources
- Commands/detect — Minecraft Wiki, CC BY-NC-SA 3.0, revision 3271205.