Skip to main content

Block State (Block Condition Type)

Checks a block state property of the block, such as facing or age.

Type ID: apoli:block_state

note

If none of the value fields are set, the condition only checks that the block has the property.

Fields

FieldTypeDefaultDescription
propertyStringrequiredThe name of the property to check, such as facing or age.
comparisonComparisonoptionalFor an integer property, how its value is compared with compare_to. Only used when the property is an integer.
compare_toIntegeroptionalFor an integer property, the number its value is compared with. Only used when the property is an integer.
valueBooleanoptionalFor a boolean property, the value it must have. Only used when the property is a boolean.
enumStringoptionalFor an enum property, the value it must have. Only used when the property is an enum.

Examples

"block_condition": {
    "type": "apoli:and",
    "conditions": [
        {
            "type": "apoli:block",
            "block": "minecraft:chest"
        },
        {
            "type": "apoli:block_state",
            "property": "facing",
            "enum": "north"
        }
    ]
}

This checks whether a chest is facing north.

"block_condition": {
	"type": "apoli:block_state",
	"property": "age"
}

This checks whether the block has the age property.