Package net.minestom.server.event.player
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 TypeMethodDescription@NotNull BlockgetBlock()Gets the block to break@NotNull BlockFaceGets the face at which the block was broken@NotNull BlockVecGets the block position.@NotNull PlayerGets the player.@NotNull BlockGets the block which will replacegetBlock().booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.voidsetResultBlock(@NotNull Block resultBlock) Changes the result of the event.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstanceMethods inherited from interface net.minestom.server.event.trait.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
Gets the face at which the block was broken- Returns:
- the block face
-
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
-