Package org.reprogle.honeypot.api.events
Class HoneypotPreInventoryClickEvent
java.lang.Object
org.bukkit.event.Event
org.reprogle.honeypot.api.events.HoneypotPreInventoryClickEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class HoneypotPreInventoryClickEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Event that is triggered when a player triggers a Honeypot via interacting with its container inventory.
This event is called before the action is taken, not after.
This event is cancellable. If cancelled, the action is not taken.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionHoneypotPreInventoryClickEvent(org.bukkit.entity.Player player, org.bukkit.inventory.Inventory inv) Called before an action is ran on a player who modified a Honeypot inventory. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerListBoilerplate function for Bukkit@NotNull org.bukkit.event.HandlerListBoilerplate function for Bukkitorg.bukkit.inventory.InventoryGet the block that was involved in the eventorg.bukkit.entity.PlayerGet the player that broke the blockbooleanCheck if the event is cancelledvoidsetCancelled(boolean cancel) Set the event as cancelled or notMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
HoneypotPreInventoryClickEvent
public HoneypotPreInventoryClickEvent(org.bukkit.entity.Player player, org.bukkit.inventory.Inventory inv) Called before an action is ran on a player who modified a Honeypot inventory. If cancelled, the modification is allowed and action isn't taken- Parameters:
player- The Player breaking with the Honeypotinv- The inventory of the block
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Boilerplate function for Bukkit- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- HandlerList
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Boilerplate function for Bukkit- Returns:
- HandlerList
-
getPlayer
public org.bukkit.entity.Player getPlayer()Get the player that broke the block- Returns:
Player
-
getInventory
public org.bukkit.inventory.Inventory getInventory()Get the block that was involved in the event- Returns:
Block
-
isCancelled
public boolean isCancelled()Check if the event is cancelled- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- True if cancelled, false if not
-
setCancelled
public void setCancelled(boolean cancel) Set the event as cancelled or not- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancel- Boolean value notating if the event is cancelled or not
-