BlockNeighborNotifyEvent
Link to blockneighbornotifyevent
Fired when a physics update occurs on a block. This event acts as a way for mods to detect physics updates, in the same way a BUD switch does. This event is only called on the server.
The event is cancelable.
If the event is canceled, vanilla logic won't be executed
The event does not have a result.
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.event.block.BlockNeighborNotifyEvent;
Extending BlockEvent
Link to extending-blockevent
BlockNeighborNotifyEvent extends BlockEvent. That means all methods available in BlockEvent are also available in BlockNeighborNotifyEvent
使用方式
Link to 使用方式
Name: getForceRedstoneUpdate
Gets if a redstone update was forced during setBlock call
Return Type: boolean
ZenScript Copy// BlockNeighborNotifyEvent.getForceRedstoneUpdate() as boolean
myBlockNeighborNotifyEvent.getForceRedstoneUpdate();
Name: getNotifiedSides
Gets a list of directions from the base block that updates will occur upon.
Return Type: Set<Direction>
ZenScript Copy// BlockNeighborNotifyEvent.getNotifiedSides() as Set<Direction>
myBlockNeighborNotifyEvent.getNotifiedSides();
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 forceRedstoneUpdate | 类型 布尔值 | 可获得 true | 可设置 false | 描述 Gets if a redstone update was forced during setBlock call |
名称 notifiedSides | 类型 Set<Direction> | 可获得 true | 可设置 false | 描述 Gets a list of directions from the base block that updates will occur upon. |