Interface RedstoneUpdateEvent

All Superinterfaces:
Cancellable, Event, RedstoneEvent

public interface RedstoneUpdateEvent extends RedstoneEvent, Cancellable
Fired when a block taking part in redstone is told that one of its neighbours changed, before it reacts: the block update that carries redstone from one block to the next.

It is fired for every update reaching a block with a RedstoneBehaviour, the ones that run RedstoneBehaviour.neighborChanged(RedstoneWorld, BlockPosition, BlockData, TypedKey), which makes it by far the most frequent redstone event: a listener should be quick. Updates reaching a block taking no part in redstone, such as stone, do nothing and fire nothing.

Cancelling the event makes the block ignore the update: a lamp does not light up, a repeater does not schedule its switch, dust does not take the new signal into account. That is how a plugin freezes the redstone of an area. Dust using Alternate Current may still change power along with the network it belongs to, without being updated itself: RedstoneDustPowerEvent covers that.

Since:
0.1.0
See Also:
  • Method Details

    • source

      TypedKey<BlockType> source()
      Returns the block type that caused the update, such as redstone dust whose power changed.
      Returns:
      the block type that caused the update, such as redstone dust whose power changed
      Since:
      0.1.0