跳到主要内容

On Craftengine Block Attempt Place Event

Triggers when a player attempts to place a CraftEngine block

Fires before CraftEngine validates the placement, so it still sees attempts that end up refused. Use the regular place event when you only care about blocks that were actually placed.

字段

字段类型默认值描述
blockIdString—The custom block ID that triggers this event (e.g., 'namespace:block_id'). Leave empty for any custom block.
locationOptional<Var<Position>>—The location where the block would be placed (optional)
permissionString—A permission the player must hold to be allowed to place. Leave empty to skip the check.
allowWhenList<Criteria>emptyFacts the player must satisfy to be allowed to place. When unmet, the placement is refused.
cancelBooleantrueWhether to stop the placement when the requirements are unmet. Turn off to only fire the triggers.
TypeWriter 通用字段(triggers)
字段类型默认值描述
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

Fires when a player tries to place a block, including when it is refused. Use permission and allowWhen to set requirements: with cancel on, an unmet requirement stops the placement. Turn cancel off to only fire the triggers. An empty permission and an empty allowWhen mean no requirement. The furniture attempt-place and furniture hit events work the same way.