Interface CollideBlockEvent
- All Superinterfaces:
Cancellable,CollideEvent,Event
- All Known Subinterfaces:
CollideBlockEvent.Fall,CollideBlockEvent.Impact,CollideBlockEvent.Inside,CollideBlockEvent.Move,CollideBlockEvent.StepOn
Fired when an
Entity collides with a BlockSnapshot.
Note that this event is fired very often. You might want to listen to one of its sub-events instead.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFires when anEntityfalls on a block.static interfaceFired when anEntityimpacts anotherBlockSnapshot.static interfaceFires when anEntityis inside a block.static interfaceFires when anEntitymoves into a block and collides with it.static interfaceFires when anEntitysteps on a block. -
Method Summary
Modifier and TypeMethodDescriptionGets the targetBlockStatebeing interacted with.Gets the targetServerLocationbeing interacted with.Gets the target "side" of theBlockStatebeing interacted with orDirection.NONEif not known.Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Method Details
-
targetLocation
ServerLocation targetLocation()Gets the targetServerLocationbeing interacted with.- Returns:
- The location
-
targetBlock
BlockState targetBlock()Gets the targetBlockStatebeing interacted with.- Returns:
- The block state
-
targetSide
Direction targetSide()Gets the target "side" of theBlockStatebeing interacted with orDirection.NONEif not known.- Returns:
- An optional containing the side being interacted with or
Direction.NONE
-