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

    Constructors
    Constructor
    Description
    BlockPlacedEvent(@NotNull org.bukkit.entity.Player player, @NotNull CustomBlock block, @NotNull org.bukkit.inventory.ItemStack item)
    Constructs a new BlockPlacedEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull CustomBlock
    Gets the block being placed.
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
    Gets the list of handlers listening to this event.
    @NotNull org.bukkit.inventory.ItemStack
    Gets the item used to place the block.
    @NotNull org.bukkit.entity.Player
    Gets the player placing the block.
    boolean
    Checks whether the event is cancelled.
    void
    setCancelled(boolean cancel)
    Sets the cancellation state of this event.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 new BlockPlacedEvent.
      Parameters:
      player - The player placing the block.
      block - The block being placed.
      item - The item used to place the block.
  • Method Details

    • getBlock

      @NotNull public @NotNull CustomBlock 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:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true if the event is cancelled; false otherwise.
    • setCancelled

      public void setCancelled(boolean cancel)
      Sets the cancellation state of this event.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true to cancel the event, false to allow it to proceed.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Gets the list of handlers listening to this event.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      The handler list.
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()