Package fr.andross.banitem.events
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
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerBanItemEvent(@NotNull org.bukkit.entity.Player player, @NotNull PlayerBanItemEvent.Type type, @NotNull BannedItem bannedItem, @NotNull BanAction action, @NotNull BanActionData actionData, @Nullable BanData... data) Construct the event with all information about the occurring banning process. -
Method Summary
Modifier and TypeMethodDescription@NotNull BanActionThe ban action.@NotNull BanActionDataThe ban action data.@NotNull BannedItemThe banned item.@Nullable BanData[]getData()The data used.static @NotNull org.bukkit.event.HandlerListBukkit event handler list.@NotNull org.bukkit.event.HandlerListInternal Bukkit event handler list.@NotNull PlayerBanItemEvent.TypegetType()Type of banning.booleanCheck if the event is cancelled.voidsetCancelled(boolean cancel) Cancel the event.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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 playertype- thePlayerBanItemEvent.Typeof banbannedItem- the item involvedaction- the action triggeredactionData- the complete data configured for the actiondata- optional additional data about the action triggered
-
-
Method Details
-
getType
Type of banning.- Returns:
- the type of ban, BLACKLIST or WHITELIST
-
getBannedItem
The banned item.- Returns:
- the banned item involved into this event
-
getAction
The ban action.- Returns:
- the action triggered
-
getActionData
The ban action data.- Returns:
- the ban action data that the banned item has in database
-
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:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- true if the event is cancelled, otherwise false
-
setCancelled
public void setCancelled(boolean cancel) Cancel the event.- Specified by:
setCancelledin interfaceorg.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:
getHandlersin classorg.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
-