Class HologramClickEvent
java.lang.Object
org.bukkit.event.Event
tk.airshipcraft.commonlib.gui.events.HologramClickEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class HologramClickEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Represents an event that is fired when a player clicks on a hologram within the game.
This event class provides details about the hologram interaction, including the player who clicked and the specific hologram.
It can be used to handle custom actions upon hologram interactions and can be cancelled to prevent default behavior.
- Since:
- 2023-04-11
- Version:
- 1.0.0
- Author:
- Locutusque
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionHologramClickEvent
(Hologram hologram, org.bukkit.entity.Player player) Constructs a HologramClickEvent with the specified hologram and the player who interacted with it. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.event.HandlerList
Returns the HandlerList for this event type.org.bukkit.event.HandlerList
Returns the handlers associated with this event.Retrieves the hologram that was clicked on by the player.org.bukkit.entity.Player
Gets the player who clicked on the hologram.boolean
Checks if the event has been cancelled.void
setCancelled
(boolean cancelled) Sets the cancellation state of the event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
HologramClickEvent
Constructs a HologramClickEvent with the specified hologram and the player who interacted with it.- Parameters:
hologram
- The Hologram object that was clicked on.player
- The Player who clicked on the hologram.
-
-
Method Details
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Returns the HandlerList for this event type. Required for custom event implementation in Bukkit.- Returns:
- The static HandlerList for HologramClickEvent.
-
getHologram
Retrieves the hologram that was clicked on by the player.- Returns:
- The Hologram instance representing the hologram that was interacted with.
-
getPlayer
public org.bukkit.entity.Player getPlayer()Gets the player who clicked on the hologram.- Returns:
- The Player instance representing the player who clicked on the hologram.
-
isCancelled
public boolean isCancelled()Checks if the event has been cancelled. A cancelled event will not proceed with the default interaction behavior.- Specified by:
isCancelled
in interfaceorg.bukkit.event.Cancellable
- Returns:
- True if the event is cancelled, false otherwise.
-
setCancelled
public void setCancelled(boolean cancelled) Sets the cancellation state of the event. Cancelling the event can prevent the default interaction behavior associated with the hologram click.- Specified by:
setCancelled
in interfaceorg.bukkit.event.Cancellable
- Parameters:
cancelled
- True to cancel the event, false to allow it to proceed.
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Returns the handlers associated with this event. Part of the Bukkit event handling mechanism.- Specified by:
getHandlers
in classorg.bukkit.event.Event
- Returns:
- The HandlerList for this event.
-