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.

Importing the class

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.

script.zs
import crafttweaker.api.event.block.BlockNeighborNotifyEvent;

Extending BlockEvent

BlockNeighborNotifyEvent extends BlockEvent. That means all methods available in BlockEvent are also available in BlockNeighborNotifyEvent

Methods

Gets if a redstone update was forced during setBlock call

Return Type: boolean

script.zs
// BlockNeighborNotifyEvent.getForceRedstoneUpdate() as boolean
myBlockNeighborNotifyEvent.getForceRedstoneUpdate();

Gets a list of directions from the base block that updates will occur upon.

Return Type: Set<Direction>

script.zs
// BlockNeighborNotifyEvent.getNotifiedSides() as Set<Direction>
myBlockNeighborNotifyEvent.getNotifiedSides();

Properties

NameTypeHas GetterHas SetterDescription
Name
forceRedstoneUpdate
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets if a redstone update was forced during setBlock call
Name
notifiedSides
Type
Set<Direction>
Has Getter
true
Has Setter
false
Description
Gets a list of directions from the base block that updates will occur upon.