org.bukkit.event
Class Event

java.lang.Object
  extended by org.bukkit.event.Event
Direct Known Subclasses:
AsyncPlayerPreLoginEvent, BlockEvent, EntityEvent, HangingEvent, InventoryEvent, InventoryMoveItemEvent, InventoryPickupItemEvent, PaintingEvent, PlayerEvent, PlayerLeashEntityEvent, PlayerPreLoginEvent, ServerEvent, VehicleEvent, WeatherEvent, WorldEvent

public abstract class Event
extends Object

Represents an event.

See Also:
PluginManager.callEvent(Event), PluginManager.registerEvents(Listener,Plugin)

Nested Class Summary
static class Event.Result
           
 
Constructor Summary
Event()
          The default constructor is defined for cleaner code.
Event(boolean isAsync)
          This constructor is used to explicitly declare an event as synchronous or asynchronous.
 
Method Summary
 String getEventName()
          Convenience method for providing a user-friendly identifier.
abstract  HandlerList getHandlers()
           
 boolean isAsynchronous()
          Any custom event that should not by synchronized with other events must use the specific constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event()
The default constructor is defined for cleaner code. This constructor assumes the event is synchronous.


Event

public Event(boolean isAsync)
This constructor is used to explicitly declare an event as synchronous or asynchronous.

Parameters:
isAsync - true indicates the event will fire asynchronously, false by default from default constructor
Method Detail

getEventName

public String getEventName()
Convenience method for providing a user-friendly identifier. By default, it is the event's class's simple name.

Returns:
name of this event

getHandlers

public abstract HandlerList getHandlers()

isAsynchronous

public final boolean isAsynchronous()
Any custom event that should not by synchronized with other events must use the specific constructor. These are the caveats of using an asynchronous event:

Returns:
false by default, true if the event fires asynchronously


Copyright © 2014. All rights reserved.