Class BlockPlacedEvent
java.lang.Object
org.bukkit.event.Event
com.github.darksoulq.abyssallib.server.event.custom.block.BlockPlacedEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class BlockPlacedEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
An event that is triggered when a player places a custom block.
This event is Cancellable, meaning the block placement can be prevented by a plugin.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionBlockPlacedEvent(@NotNull org.bukkit.entity.Player player, @NotNull CustomBlock block, @NotNull org.bukkit.inventory.ItemStack item) Constructs a newBlockPlacedEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull CustomBlockgetBlock()Gets the block being placed.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the list of handlers listening to this event.@NotNull org.bukkit.inventory.ItemStackgetItem()Gets the item used to place the block.@NotNull org.bukkit.entity.PlayerGets the player placing the block.booleanChecks whether the event is cancelled.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
BlockPlacedEvent
public BlockPlacedEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull CustomBlock block, @NotNull @NotNull org.bukkit.inventory.ItemStack item) Constructs a newBlockPlacedEvent.- Parameters:
player- The player placing the block.block- The block being placed.item- The item used to place the block.
-
-
Method Details
-
getBlock
Gets the block being placed.- Returns:
- The block being placed.
-
getPlayer
@NotNull public @NotNull org.bukkit.entity.Player getPlayer()Gets the player placing the block.- Returns:
- The player placing the block.
-
getItem
@NotNull public @NotNull org.bukkit.inventory.ItemStack getItem()Gets the item used to place the block.- Returns:
- The item used to place the block.
-
isCancelled
public boolean isCancelled()Checks whether the event is cancelled.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
trueif the event is cancelled;falseotherwise.
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel-trueto cancel the event,falseto allow it to proceed.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers listening to this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- The handler list.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-