Class PlayerOpenEnderChestEvent

java.lang.Object
fr.fidorial.event.player.PlayerOpenEnderChestEvent
All Implemented Interfaces:
Cancellable, Event, PlayerEvent

public final class PlayerOpenEnderChestEvent extends Object implements PlayerEvent, Cancellable
Fired right before a player opens an ender chest.

Cancelling the event keeps the container closed.

Since:
0.1.0
  • Constructor Details

    • PlayerOpenEnderChestEvent

      public PlayerOpenEnderChestEvent(Player player, BlockPos position, EnderChestInventory enderChest)
      Creates an event.
      Parameters:
      player - the player opening the ender chest
      position - the position of the ender chest block
      enderChest - the container about to be displayed
      Since:
      0.1.0
  • Method Details

    • player

      public Player player()
      Description copied from interface: PlayerEvent
      Returns the player involved in this event.
      Specified by:
      player in interface PlayerEvent
      Returns:
      the player involved in this event
    • position

      public BlockPos position()
      Returns the position of the ender chest block.
      Returns:
      the position of the ender chest block
      Since:
      0.1.0
    • enderChest

      public EnderChestInventory enderChest()
      Returns the container about to be displayed; changes made to it are kept.
      Returns:
      the container about to be displayed; changes made to it are kept
      Since:
      0.1.0
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Returns true if the action this event describes will not happen.
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      true if the action this event describes will not happen
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: Cancellable
      Prevents or re-allows the action this event describes.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancelled - true to prevent it