Skip to main content

Modify Block State (Block Action Type)

Changes one block state property of the block. Each kind of property takes a different field: boolean properties use value, enum properties use enum, and integer properties use operation and change.

Type ID: apoli:modify_block_state

note

If none of the fields the property expects are set, the action does nothing.

Fields

FieldTypeDefaultDescription
propertyStringrequiredThe name of the property to change, such as facing or age.
operationString"add"How change is applied to an integer property: "add" or "set".
changeIntegeroptionalFor an integer property, the value to add, subtract or set.
valueBooleanoptionalFor a boolean property, the new value.
enumStringoptionalFor an enum property, the new value.
cycleBooleanfalseWith true, moves the property to its next value in the cycle and ignores the other optional fields. It works on every kind of property.

Examples

"block_action": {
	"type": "apoli:modify_block_state",
	"property": "facing",
	"cycle": true
}

This cycles through the values of the facing property, if the block has one.