Block State
Checks a block state property of the block. Depending on the property type, different values are expected: boolean properties use value, enumeration properties use enum, and integer properties use comparison and compare_to.
Type ID: origins:block_state
Note
If none of the expected fields are specified, this condition will just check if the block has the specified property.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
property |
String | The name of the property that will be checked. Examples are facing or age. See: Minecraft Fandom Wiki: Block States (List of block states) |
|
comparison |
Comparison | optional | If specified, determines how the specified property will be compared to a specified value. If not and the property is an integer, it will just check if the block has the specified property. |
compare_to |
Integer | optional | If specified, the value to compare to the value of the specified property. |
value |
Boolean | optional | If specified, the boolean to compare to the value of the specified property if the specified property is a boolean. |
enum |
String | optional | If specified, the string to compare to the specified property if the specified property is a string. |
Examples
"block_condition": {
"type": "origins:and",
"conditions": [
{
"type": "origins:block",
"block": "minecraft:chest"
},
{
"type": "origins:block_state",
"property": "facing",
"enum": "north"
}
]
}
This example will check if a Chest block is facing north.
"block_condition": {
"type": "origins:block_state",
"property": "age"
}
This example will check if the specified block has the age Block State property.