Class PlayerBlockBreakEvent
java.lang.Object
net.minestom.server.event.player.PlayerBlockBreakEvent
- All Implemented Interfaces:
Event, BlockEvent, CancellableEvent, EntityEvent, EntityInstanceEvent, InstanceEvent, PlayerEvent, PlayerInstanceEvent
public class PlayerBlockBreakEvent
extends Object
implements PlayerInstanceEvent, BlockEvent, CancellableEvent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBlock()Gets the block to breakGets the face at which the block was brokenGets the block position.Gets the player.Gets the block which will replacegetBlock().booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.voidsetResultBlock(Block resultBlock) Changes the result of the event.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityInstanceEvent
getInstanceMethods inherited from interface PlayerEvent
getEntity
-
Constructor Details
-
PlayerBlockBreakEvent
-
-
Method Details
-
getBlock
Gets the block to break- Specified by:
getBlockin interfaceBlockEvent- Returns:
- the block
-
getResultBlock
Gets the block which will replacegetBlock().- Returns:
- the result block
-
getBlockFace
-
setResultBlock
Changes the result of the event.- Parameters:
resultBlock- the new block
-
getBlockPosition
Gets the block position.- Specified by:
getBlockPositionin interfaceBlockEvent- Returns:
- the block position
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEventGets if theEventshould be cancelled or not.- Specified by:
isCancelledin interfaceCancellableEvent- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEventMarks theEventas cancelled or not.- Specified by:
setCancelledin interfaceCancellableEvent- Parameters:
cancel- true if the event should be cancelled, false otherwise
-
getPlayer
Description copied from interface:PlayerEventGets the player.- Specified by:
getPlayerin interfacePlayerEvent- Returns:
- the player
-