Interface IBlockAndCoordinateEventSensor

All Superinterfaces:
IBaseSensor
All Known Implementing Classes:
BlockInteractSensor

public interface IBlockAndCoordinateEventSensor extends IBaseSensor
  • Method Details

    • emitRedstoneOnEvent

      int emitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event, net.minecraft.world.level.block.entity.BlockEntity sensor, int range, Set<net.minecraft.core.BlockPos> positions)
      Extended version of the normal emitRedstoneOnEvent. This method will only invoke with a valid GPS tool, and when all the coordinates are within range.
      Parameters:
      event - the Forge event (one of PlayerInteractEvent, EntityItemPickupEvent or AttackEntityEvent)
      sensor - the Universal Sensor block entity
      range - the Universal Sensor's range, in blocks
      positions - When a GPS Tool is inserted this contains the position of that tool. If a GPS Area Tool is inserted this is set of all positions in that area.
      Returns:
      the redstone level that should be emitted
    • getRedstonePulseLength

      int getRedstonePulseLength()
      Returns:
      a redstone pulse length, in ticks