Class BlockEvent.NeighborNotifyEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.BlockEvent.NeighborNotifyEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
BlockEvent

public static class BlockEvent.NeighborNotifyEvent extends BlockEvent implements net.neoforged.bus.api.ICancellableEvent
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.
  • Field Details

    • notifiedSides

      private final EnumSet<net.minecraft.core.Direction> notifiedSides
    • forceRedstoneUpdate

      private final boolean forceRedstoneUpdate
  • Constructor Details

    • NeighborNotifyEvent

      public NeighborNotifyEvent(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, EnumSet<net.minecraft.core.Direction> notifiedSides, boolean forceRedstoneUpdate)
  • Method Details

    • getNotifiedSides

      public EnumSet<net.minecraft.core.Direction> getNotifiedSides()
      Gets a list of directions from the base block that updates will occur upon.
      Returns:
      list of notified directions
    • getForceRedstoneUpdate

      public boolean getForceRedstoneUpdate()
      Get if redstone update was forced during setBlock call (0x16 to flags)
      Returns:
      if the flag was set