Class BlockBreakEvent
java.lang.Object
fr.fidorial.event.block.BlockBreakEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
Fired when a player breaks a block, before the block is removed from the world.
Cancelling the event keeps the block in place and resyncs the position to the client.
- Since:
- 0.1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the action this event describes will not happen.player()Returns the player involved in this event.position()Returns the position of the block.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.world()Returns the world the block belongs to, that is the world of the player.
-
Constructor Details
-
BlockBreakEvent
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
world
Returns the world the block belongs to, that is the world of the player.- Returns:
- the world the block belongs to, that is the world of the player
- Since:
- 0.1.0
-
position
Returns the position of the block.- Returns:
- the position of the block
- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-