Interface CollideBlockEvent
-
- All Superinterfaces:
Cancellable
,CollideEvent
,Event
- All Known Subinterfaces:
CollideBlockEvent.Fall
,CollideBlockEvent.Impact
,CollideBlockEvent.Inside
,CollideBlockEvent.Move
,CollideBlockEvent.StepOn
public interface CollideBlockEvent extends CollideEvent
Fired when anEntity
collides with aBlockSnapshot
.Note that this event is fired very often. You might want to listen to one of its sub-events instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
CollideBlockEvent.Fall
Fires when anEntity
falls on a block.static interface
CollideBlockEvent.Impact
Fired when anEntity
impacts anotherBlockSnapshot
.static interface
CollideBlockEvent.Inside
Fires when anEntity
is inside a block.static interface
CollideBlockEvent.Move
Fires when anEntity
moves into a block and collides with it.static interface
CollideBlockEvent.StepOn
Fires when anEntity
steps on a block.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BlockState
targetBlock()
Gets the targetBlockState
being interacted with.ServerLocation
targetLocation()
Gets the targetServerLocation
being interacted with.Direction
targetSide()
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 Detail
-
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
-
-