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
Modifier and TypeInterfaceDescriptionstatic interface
Fires when anEntity
falls on a block.static interface
Fired when anEntity
impacts anotherBlockSnapshot
.static interface
Fires when anEntity
is inside a block.static interface
Fires when anEntity
moves into a block and collides with it.static interface
Fires when anEntity
steps on a block. -
Method Summary
Modifier and TypeMethodDescriptionGets the targetBlockState
being interacted with.Gets the targetServerLocation
being interacted with.Gets the target "side" of theBlockState
being interacted with orDirection.NONE
if not known.Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Method Details
-
targetLocation
ServerLocation targetLocation()Gets the targetServerLocation
being interacted with.- Returns:
- The location
-
targetBlock
BlockState targetBlock()Gets the targetBlockState
being interacted with.- Returns:
- The block state
-
targetSide
Direction targetSide()Gets the target "side" of theBlockState
being interacted with orDirection.NONE
if not known.- Returns:
- An optional containing the side being interacted with or
Direction.NONE
-