Skip to content

Command

apace100 edited this page Mar 12, 2021 · 1 revision

Entity Condition. Compares the result of a command to a specified value.

Type ID: origins:command

Fields:

command, string: Command to run.

comparison, Comparison: How to compare the command's result to the specified value.

compare_to, int: Which value to compare the command's result to.

permission_level, int, default = 4: The permission level to use for the command. 0 is a "survival player", anything higher emulates some form of operator. See Minecraft Wiki (op-permission-level) for details.

Example:

"condition": {
    "type": "origins:command",
    "command": "execute if entity @e[distance=..3,type=creeper,nbt={powered:1b}]",
    "comparison": ">",
    "compare_to": 1
}

The command counts the number of supercharged creepers in a 3 block radius from the entity, and the condition returns true if there at least 2.

Clone this wiki locally