Class ZentrixEvent
java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
- Direct Known Subclasses:
CurrencyChangeEvent,ZentrixGameEvent
public abstract class ZentrixEvent
extends org.bukkit.event.Event
Base class for all Zentrix events.
All custom events fired by Zentrix extend this class, providing a common base for addon developers to work with. Events allow addons to react to game state changes, player actions, and other significant occurrences.
Listening to Events
public class MyListener implements Listener {
@EventHandler
public void onGameStart(GameStartEvent event) {
ZentrixGame game = event.getGame();
int playerCount = game.getPlayerCount();
Bukkit.broadcastMessage("A game started with " + playerCount + " players!");
}
}
Available Event Categories
- Game Events - Game lifecycle events (start, end, phase changes)
- Player Events - Player-specific events (join, leave, death, kill)
- Team Events - Team-related events (elimination, win)
- Currency Events - Economy events (balance changes, rewards)
- Since:
- 1.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a new synchronous Zentrix event.protectedZentrixEvent(boolean isAsync) Constructs a new Zentrix event. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull org.bukkit.event.HandlerListGets the static handler list for this event type.@NotNull org.bukkit.event.HandlerListGets the handler list for this event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ZentrixEvent
protected ZentrixEvent()Constructs a new synchronous Zentrix event. -
ZentrixEvent
protected ZentrixEvent(boolean isAsync) Constructs a new Zentrix event.- Parameters:
isAsync-trueif the event is fired asynchronously,falseif fired on the main thread
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the handler list for this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- The handler list
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()Gets the static handler list for this event type.Required by Bukkit's event system.
- Returns:
- The handler list
-