Usercontent Commands
All commands that should be modifiable or executable by the system or are visible in the command preview need to be modeled. Arguments with the same name will share the same value.
"": { #Id of the command
"label": "", #A label from the tree of this command. This label will be used in the command preview.
"syntax": {
"name": "", #The name of this argument
"label": "", #The label of this argument
"type": "", #The type of this argument (See table below for available types)
"children": [
...
]
},
"visible": {
#See widget-states
}
}
| Argument types | Comment |
|---|---|
| short | A default short |
| byte | A default byte |
| int | A default int |
| float | A default float |
| double | A default double |
| long | A default long |
| boolean | A default boolean |
| word | A string that can only consist of 0-9, A-Z, a-z and _-.+. Any other character will be replaced by _
|
| string | A string that can only consist of 0-9, A-Z, a-z and _-.+. Any other character will be escaped by \
|
| greedy_string | A default string |
| resource_location | Minecraft resource location. Example: namespace:resource
|
| item | Minecraft resource location that only accepts valid items |
| blockstate | Minecraft resource location with attached properties and nbt. Example: namespace:resource[state=1]{"nbt":"example"}
|
| blockpredicate | Either a Minecraft resource location or block tag with attached properties and nbt. Example: #namespace:resource[state=1]{"nbt":"example"}
|
| nbt | Minecraft data structure. Example: {"nbt":"example"}
|
| coordinate_int | An integer that that can also be relative (~) or local (^). Examples: 1, ~2, ^3
|
| coordinate_double | A double that that can also be relative (~) or local (^). Examples: 1.0, ~2.0, ^3.0
|
| player | Username of the current player. It be automatically set by the system |
| range_int | A range specified by integers. Example: 1..2, ..3, 4..
|
| range_double | A range specified by doubles. Example: 1.0..2.0, ..3.0, 4.0..
|
| angle | A float that can also be relative. Example: 90.0, ~90.0
|
| enchantment | Minecraft resource location that only accepts valid enchantments |
| entity | Minecraft resource location that only accepts valid entities |
| gamemode | Valid values: survival, creative, adventure, spectator
|
| time | An integer with a time unit (default: ticks). Valid units: t (ticks), s (seconds), d (days) |
| effect | Minecraft resource location that only accepts valid effects |
| axis | Valid values: x, y, z
|
| anchor | Valid values: feet, eyes
|
| difficulty | Valid values: peaceful, easy, normal, hard
|
| render_type | Valid values: integer, hearts
|
| operation | Valid values: =, +=, -=, *=, /=, %=, <, >
|
| text_component | Either a string or a json-serialized text component. Example: string, {"text":"string"}
|
| relation | Valid values: <, <=, =, >=, >
|
| type | Valid values: byte, double, float, int, long, short
|
| linkage | Valid values: append, insert, merge, prepend, set
|
| nbt_path | Minecraft nbt path. Example: foo.bar, {foo:bar}
|
| item_predicate | Either a Minecraft resource location or item tag with attached nbt. Example: #namespace:resource{"nbt":"example"}
|
| criteria | A string where every is replaced by _
|