Bukkit  1.7.9-R0.2-63-gcb87f4e
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.event.Event Class Referenceabstract

Represents an event. More...

+ Inheritance diagram for org.bukkit.event.Event:

Classes

enum  Result
 

Public Member Functions

 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.
 
String getEventName ()
 Convenience method for providing a user-friendly identifier.
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 Any custom event that should not by synchronized with other events must use the specific constructor.
 

Detailed Description

Represents an event.

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

Definition at line 11 of file Event.java.

Constructor & Destructor Documentation

org.bukkit.event.Event.Event ( )

The default constructor is defined for cleaner code.

This constructor assumes the event is synchronous.

Definition at line 19 of file Event.java.

org.bukkit.event.Event.Event ( boolean  isAsync)

This constructor is used to explicitly declare an event as synchronous or asynchronous.

Parameters
isAsynctrue indicates the event will fire asynchronously, false by default from default constructor

Definition at line 30 of file Event.java.

Member Function Documentation

String org.bukkit.event.Event.getEventName ( )

Convenience method for providing a user-friendly identifier.

By default, it is the event's class's Class::getSimpleName() simple name}.

Returns
name of this event

Definition at line 41 of file Event.java.

Referenced by org.bukkit.plugin.SimplePluginManager.callEvent().

abstract HandlerList org.bukkit.event.Event.getHandlers ( )
pure virtual

Implemented in org.bukkit.event.inventory.InventoryClickEvent, org.bukkit.event.entity.EntityDamageEvent, org.bukkit.event.player.PlayerInteractEvent, org.bukkit.event.player.PlayerCommandPreprocessEvent, org.bukkit.event.player.AsyncPlayerPreLoginEvent, org.bukkit.event.inventory.InventoryDragEvent, org.bukkit.event.player.PlayerLoginEvent, org.bukkit.event.player.AsyncPlayerChatEvent, org.bukkit.event.block.BlockIgniteEvent, org.bukkit.event.player.PlayerEggThrowEvent, org.bukkit.event.server.ServerListPingEvent, org.bukkit.event.player.PlayerChatEvent, org.bukkit.event.player.PlayerPreLoginEvent, org.bukkit.event.block.BlockPlaceEvent, org.bukkit.event.enchantment.EnchantItemEvent, org.bukkit.event.player.PlayerEditBookEvent, org.bukkit.event.player.PlayerStatisticIncrementEvent, org.bukkit.event.player.PlayerFishEvent, org.bukkit.event.inventory.InventoryMoveItemEvent, org.bukkit.event.inventory.FurnaceBurnEvent, org.bukkit.event.enchantment.PrepareItemEnchantEvent, org.bukkit.event.world.StructureGrowEvent, org.bukkit.event.entity.EntityChangeBlockEvent, org.bukkit.event.player.PlayerMoveEvent, org.bukkit.event.entity.PotionSplashEvent, org.bukkit.event.entity.EntityRegainHealthEvent, org.bukkit.event.vehicle.VehicleDamageEvent, org.bukkit.event.block.BlockCanBuildEvent, org.bukkit.event.player.PlayerPortalEvent, org.bukkit.event.server.ServerCommandEvent, org.bukkit.event.entity.EntityExplodeEvent, org.bukkit.event.block.BlockDispenseEvent, org.bukkit.event.block.SignChangeEvent, org.bukkit.event.entity.EntityShootBowEvent, org.bukkit.event.block.BlockDamageEvent, org.bukkit.event.block.NotePlayEvent, org.bukkit.event.entity.CreatureSpawnEvent, org.bukkit.event.entity.EntityPortalEvent, org.bukkit.event.entity.ExplosionPrimeEvent, org.bukkit.event.inventory.FurnaceSmeltEvent, org.bukkit.event.entity.HorseJumpEvent, org.bukkit.event.entity.EntityTeleportEvent, org.bukkit.event.painting.PaintingBreakEvent, org.bukkit.event.painting.PaintingPlaceEvent, org.bukkit.event.entity.EntityTargetEvent, org.bukkit.event.entity.ExpBottleEvent, org.bukkit.event.player.PlayerKickEvent, org.bukkit.event.player.PlayerItemConsumeEvent, org.bukkit.event.player.PlayerTeleportEvent, org.bukkit.event.entity.EntityDeathEvent, org.bukkit.event.block.BlockFromToEvent, org.bukkit.event.hanging.HangingBreakEvent, org.bukkit.event.hanging.HangingPlaceEvent, org.bukkit.event.player.PlayerChatTabCompleteEvent, org.bukkit.event.entity.CreeperPowerEvent, org.bukkit.event.entity.FoodLevelChangeEvent, org.bukkit.event.entity.EntityCreatePortalEvent, org.bukkit.event.entity.PigZapEvent, org.bukkit.event.inventory.InventoryOpenEvent, org.bukkit.event.block.BlockPhysicsEvent, org.bukkit.event.entity.SheepDyeWoolEvent, org.bukkit.event.world.PortalCreateEvent, org.bukkit.event.entity.EntityPortalExitEvent, org.bukkit.event.entity.PlayerLeashEntityEvent, org.bukkit.event.player.PlayerRespawnEvent, org.bukkit.event.block.BlockFadeEvent, org.bukkit.event.block.BlockPistonExtendEvent, org.bukkit.event.entity.EntityCombustEvent, org.bukkit.event.entity.SlimeSplitEvent, org.bukkit.event.inventory.InventoryEvent, org.bukkit.event.vehicle.VehicleEntityCollisionEvent, org.bukkit.event.inventory.InventoryPickupItemEvent, org.bukkit.event.player.PlayerPickupItemEvent, org.bukkit.event.block.BlockGrowEvent, org.bukkit.event.inventory.PrepareItemCraftEvent, org.bukkit.event.player.PlayerItemHeldEvent, org.bukkit.event.block.BlockRedstoneEvent, org.bukkit.event.entity.ItemDespawnEvent, org.bukkit.event.player.PlayerVelocityEvent, org.bukkit.event.player.PlayerAnimationEvent, org.bukkit.event.entity.EntityTameEvent, org.bukkit.event.entity.ItemSpawnEvent, org.bukkit.event.block.BlockSpreadEvent, org.bukkit.event.vehicle.VehicleMoveEvent, org.bukkit.event.inventory.BrewEvent, org.bukkit.event.vehicle.VehicleDestroyEvent, org.bukkit.event.player.PlayerShearEntityEvent, org.bukkit.event.entity.EntityInteractEvent, org.bukkit.event.player.PlayerAchievementAwardedEvent, org.bukkit.event.player.PlayerBedEnterEvent, org.bukkit.event.player.PlayerDropItemEvent, org.bukkit.event.player.PlayerGameModeChangeEvent, org.bukkit.event.player.PlayerInteractEntityEvent, org.bukkit.event.player.PlayerLevelChangeEvent, org.bukkit.event.vehicle.VehicleEnterEvent, org.bukkit.event.vehicle.VehicleExitEvent, org.bukkit.event.weather.LightningStrikeEvent, org.bukkit.event.block.BlockExpEvent, org.bukkit.event.player.PlayerToggleFlightEvent, org.bukkit.event.player.PlayerToggleSneakEvent, org.bukkit.event.player.PlayerToggleSprintEvent, org.bukkit.event.weather.ThunderChangeEvent, org.bukkit.event.weather.WeatherChangeEvent, org.bukkit.event.player.PlayerExpChangeEvent, org.bukkit.event.player.PlayerInventoryEvent, org.bukkit.event.player.PlayerJoinEvent, org.bukkit.event.player.PlayerQuitEvent, org.bukkit.event.entity.ProjectileLaunchEvent, org.bukkit.event.entity.SheepRegrowWoolEvent, org.bukkit.event.block.BlockFormEvent, org.bukkit.event.player.PlayerItemBreakEvent, org.bukkit.event.block.BlockBurnEvent, org.bukkit.event.world.ChunkLoadEvent, org.bukkit.event.world.SpawnChangeEvent, org.bukkit.event.block.LeavesDecayEvent, org.bukkit.event.entity.EntityPortalEnterEvent, org.bukkit.event.player.PlayerBedLeaveEvent, org.bukkit.event.player.PlayerChangedWorldEvent, org.bukkit.event.vehicle.VehicleBlockCollisionEvent, org.bukkit.event.block.BlockPistonRetractEvent, org.bukkit.event.entity.EntityUnleashEvent, org.bukkit.event.inventory.InventoryCloseEvent, org.bukkit.event.server.MapInitializeEvent, org.bukkit.event.world.ChunkUnloadEvent, org.bukkit.event.world.WorldUnloadEvent, org.bukkit.event.player.PlayerChannelEvent, org.bukkit.event.entity.ProjectileHitEvent, org.bukkit.event.player.PlayerBucketEmptyEvent, org.bukkit.event.player.PlayerBucketFillEvent, org.bukkit.event.world.ChunkPopulateEvent, org.bukkit.event.server.ServiceRegisterEvent, org.bukkit.event.server.ServiceUnregisterEvent, org.bukkit.event.server.RemoteServerCommandEvent, org.bukkit.event.server.PluginDisableEvent, org.bukkit.event.server.PluginEnableEvent, org.bukkit.event.vehicle.VehicleCreateEvent, org.bukkit.event.vehicle.VehicleUpdateEvent, org.bukkit.event.world.WorldInitEvent, org.bukkit.event.world.WorldLoadEvent, and org.bukkit.event.world.WorldSaveEvent.

final boolean org.bukkit.event.Event.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:

  • The event is never fired from inside code triggered by a synchronous event. Attempting to do so results in an java.lang.IllegalStateException.
  • However, asynchronous event handlers may fire synchronous or asynchronous events
  • The event may be fired multiple times simultaneously and in any order.
  • Any newly registered or unregistered handler is ignored after an event starts execution.
  • The handlers for this event may block for any length of time.
  • Some implementations may selectively declare a specific event use as asynchronous. This behavior should be clearly defined.
  • Asynchronous calls are not calculated in the plugin timing system.
Returns
false by default, true if the event fires asynchronously

Definition at line 72 of file Event.java.

Referenced by org.bukkit.plugin.SimplePluginManager.callEvent().


The documentation for this class was generated from the following file: