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
-
Method Summary
Modifier and TypeMethodDescription@NotNull Block
getBlock()
Gets the block to break@NotNull BlockFace
Gets the face at which the block was broken@NotNull BlockVec
Gets the block position.@NotNull Player
Gets the player.@NotNull Block
Gets the block which will replacegetBlock()
.boolean
Gets if theEvent
should be cancelled or not.void
setCancelled
(boolean cancel) Marks theEvent
as cancelled or not.void
setResultBlock
(@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, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
PlayerBlockBreakEvent
-
-
Method Details
-
getBlock
Gets the block to break- Specified by:
getBlock
in 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:
getBlockPosition
in interfaceBlockEvent
- Returns:
- the block position
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEvent
Gets if theEvent
should be cancelled or not.- Specified by:
isCancelled
in interfaceCancellableEvent
- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEvent
Marks theEvent
as cancelled or not.- Specified by:
setCancelled
in interfaceCancellableEvent
- Parameters:
cancel
- true if the event should be cancelled, false otherwise
-
getPlayer
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-