-
Method Summary
int
emitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event,
net.minecraft.world.level.block.entity.BlockEntity sensor,
int range,
String textboxText)
This method is called when a Forge event of interest is triggered.
int
How long should an emitted pulse last for? 5 ticks is a suitable value.
-
Method Details
-
emitRedstoneOnEvent
int emitRedstoneOnEvent(net.minecraftforge.eventbus.api.Event event,
net.minecraft.world.level.block.entity.BlockEntity sensor,
int range,
String textboxText)
This method is called when a Forge event of interest is triggered. Events of interest are:
PlayerInteractEvent
EntityItemPickupEvent
AttackEntityEvent
- 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
textboxText - any text which was entered in the sensor configuration's textfield
- Returns:
- the redstone strength which should be emitted
-
getRedstonePulseLength
int getRedstonePulseLength()
How long should an emitted pulse last for? 5 ticks is a suitable value.
- Returns:
- a redstone pulse length, in ticks