Class PlayerBanItemEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
fr.andross.banitem.events.PlayerBanItemEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public final class PlayerBanItemEvent extends org.bukkit.event.player.PlayerEvent implements org.bukkit.event.Cancellable
Called when an item should be banned. This is only for check purpose, no modifications can be made. Cancelling the event will cancel the ban process.
Version:
3.3
Author:
Andross
  • Constructor Details

    • PlayerBanItemEvent

      public PlayerBanItemEvent(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull PlayerBanItemEvent.Type type, @NotNull @NotNull BannedItem bannedItem, @NotNull @NotNull BanAction action, @NotNull @NotNull BanActionData actionData, @Nullable @Nullable BanData... data)
      Construct the event with all information about the occurring banning process.
      Parameters:
      player - the involved player
      type - the PlayerBanItemEvent.Type of ban
      bannedItem - the item involved
      action - the action triggered
      actionData - the complete data configured for the action
      data - optional additional data about the action triggered
  • Method Details

    • getType

      @NotNull public @NotNull PlayerBanItemEvent.Type getType()
      Type of banning.
      Returns:
      the type of ban, BLACKLIST or WHITELIST
    • getBannedItem

      @NotNull public @NotNull BannedItem getBannedItem()
      The banned item.
      Returns:
      the banned item involved into this event
    • getAction

      @NotNull public @NotNull BanAction getAction()
      The ban action.
      Returns:
      the action triggered
    • getActionData

      @NotNull public @NotNull BanActionData getActionData()
      The ban action data.
      Returns:
      the ban action data that the banned item has in database
    • getData

      @Nullable public @Nullable BanData[] getData()
      The data used.
      Returns:
      all the ban datas used into this event
    • isCancelled

      public boolean isCancelled()
      Check if the event is cancelled.
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
      Returns:
      true if the event is cancelled, otherwise false
    • setCancelled

      public void setCancelled(boolean cancel)
      Cancel the event.
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Internal Bukkit event handler list.
      Specified by:
      getHandlers in class org.bukkit.event.Event
      Returns:
      internal bukkit event handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()
      Bukkit event handler list.
      Returns:
      the bukkit event handler list