Package org.spongepowered.api.event
Interface Event
-
- All Known Subinterfaces:
AdvancementEvent
,AdvancementEvent.Grant
,AdvancementEvent.Revoke
,AdvancementTreeEvent
,AdvancementTreeEvent.GenerateLayout
,AffectEntityEvent
,AffectItemStackEvent
,AffectSlotEvent
,AnimateHandEvent
,AttackEntityEvent
,AudienceMessageEvent
,BanIpEvent
,BanUserEvent
,BreedingEvent
,BreedingEvent.Breed
,BreedingEvent.FindMate
,BreedingEvent.ReadyToMate
,BrewingEvent
,BrewingEvent.ConsumeFuel
,BrewingEvent.Finish
,BrewingEvent.Interrupt
,BrewingEvent.Start
,BrewingEvent.Tick
,ChangeBlockEvent
,ChangeBlockEvent.All
,ChangeBlockEvent.Post
,ChangeBlockEvent.Pre
,ChangeDataHolderEvent
,ChangeDataHolderEvent.ValueChange
,ChangeEntityEquipmentEvent
,ChangeEntityEquipmentEvent.Break
,ChangeEntityWorldEvent
,ChangeEntityWorldEvent.Post
,ChangeEntityWorldEvent.Pre
,ChangeEntityWorldEvent.Reposition
,ChangeInventoryEvent
,ChangeInventoryEvent.Drop
,ChangeInventoryEvent.Drop.Full
,ChangeInventoryEvent.Drop.Single
,ChangeInventoryEvent.Held
,ChangeInventoryEvent.Pickup
,ChangeInventoryEvent.Pickup.Pre
,ChangeInventoryEvent.SwapHand
,ChangeSignEvent
,ChangeWeatherEvent
,ChangeWorldBorderEvent
,ChangeWorldBorderEvent.Player
,ChangeWorldBorderEvent.World
,ChunkEvent
,ChunkEvent.Generated
,ChunkEvent.Load
,ChunkEvent.Save
,ChunkEvent.Save.Post
,ChunkEvent.Save.Pre
,ChunkEvent.Unload
,ChunkEvent.Unload.Post
,ChunkEvent.Unload.Pre
,ChunkEvent.WorldScoped
,ClickContainerEvent
,ClickContainerEvent.Creative
,ClickContainerEvent.Creative.Drop
,ClickContainerEvent.Creative.Set
,ClickContainerEvent.Double
,ClickContainerEvent.Drag
,ClickContainerEvent.Drag.Middle
,ClickContainerEvent.Drag.Primary
,ClickContainerEvent.Drag.Secondary
,ClickContainerEvent.Drop
,ClickContainerEvent.Drop.Full
,ClickContainerEvent.Drop.Outside
,ClickContainerEvent.Drop.Outside.Primary
,ClickContainerEvent.Drop.Outside.Secondary
,ClickContainerEvent.Drop.Single
,ClickContainerEvent.Middle
,ClickContainerEvent.NumberPress
,ClickContainerEvent.Primary
,ClickContainerEvent.Recipe
,ClickContainerEvent.Recipe.All
,ClickContainerEvent.Recipe.Single
,ClickContainerEvent.Secondary
,ClickContainerEvent.SelectTrade
,ClickContainerEvent.Shift
,ClickContainerEvent.Shift.Primary
,ClickContainerEvent.Shift.Secondary
,ClientPingServerEvent
,CollideBlockEvent
,CollideBlockEvent.Fall
,CollideBlockEvent.Impact
,CollideBlockEvent.Inside
,CollideBlockEvent.Move
,CollideBlockEvent.StepOn
,CollideEntityEvent
,CollideEntityEvent.Impact
,CollideEvent
,CollideEvent.Impact
,ConstructEntityEvent
,ConstructEntityEvent.Post
,ConstructEntityEvent.Pre
,ConstructPluginEvent
,CookingEvent
,CookingEvent.ConsumeFuel
,CookingEvent.Finish
,CookingEvent.Interrupt
,CookingEvent.Start
,CookingEvent.Tick
,CooldownEvent
,CooldownEvent.End
,CooldownEvent.Set
,CraftItemEvent
,CraftItemEvent.Craft
,CraftItemEvent.Preview
,CreateMapEvent
,CriterionEvent
,CriterionEvent.Grant
,CriterionEvent.Revoke
,CriterionEvent.Score
,CriterionEvent.Score.Change
,CriterionEvent.Score.Grant
,CriterionEvent.Score.Revoke
,CriterionEvent.Trigger<C>
,DamageEntityEvent
,DefuseExplosiveEvent
,DefuseExplosiveEvent.Post
,DefuseExplosiveEvent.Pre
,DestructEntityEvent
,DestructEntityEvent.Death
,DetonateExplosiveEvent
,DropItemEvent
,DropItemEvent.Close
,DropItemEvent.Custom
,DropItemEvent.Destruct
,DropItemEvent.Dispense
,DropItemEvent.Pre
,EconomyTransactionEvent
,EnchantItemEvent
,EnchantItemEvent.CalculateEnchantment
,EnchantItemEvent.CalculateLevelRequirement
,EnchantItemEvent.Post
,EngineLifecycleEvent<E>
,ExecuteCommandEvent
,ExecuteCommandEvent.Post
,ExecuteCommandEvent.Pre
,ExpireEntityEvent
,ExplosionEvent
,ExplosionEvent.Detonate
,ExplosionEvent.Pre
,FishingEvent
,FishingEvent.HookEntity
,FishingEvent.Start
,FishingEvent.Stop
,GenericEvent<T>
,GoalEvent
,GoalEvent.Add
,GoalEvent.Remove
,HarvestEntityEvent
,IgniteEntityEvent
,InteractBlockEvent
,InteractBlockEvent.Primary
,InteractBlockEvent.Primary.Finish
,InteractBlockEvent.Primary.Start
,InteractBlockEvent.Primary.Stop
,InteractBlockEvent.Secondary
,InteractContainerEvent
,InteractContainerEvent.Close
,InteractContainerEvent.Open
,InteractEntityEvent
,InteractEntityEvent.Primary
,InteractEntityEvent.Secondary
,InteractEntityEvent.Secondary.At
,InteractEntityEvent.Secondary.On
,InteractEvent
,InteractItemEvent
,InteractItemEvent.Primary
,InteractItemEvent.Secondary
,ItemMergeWithItemEvent
,KickPlayerEvent
,LeashEntityEvent
,LifecycleEvent
,LightningEvent
,LightningEvent.Post
,LightningEvent.Pre
,LightningEvent.Strike
,LoadedGameEvent
,LoadWorldEvent
,MessageEvent
,MoveEntityEvent
,NotifyNeighborBlockEvent
,PardonIpEvent
,PardonUserEvent
,PlayerChangeClientSettingsEvent
,PlayerChatEvent
,PlaySoundEvent
,PlaySoundEvent.AtEntity
,PlaySoundEvent.Broadcast
,PlaySoundEvent.NoteBlock
,PlaySoundEvent.Record
,PlaySoundEvent.Record.Start
,PlaySoundEvent.Record.Stop
,PrimeExplosiveEvent
,PrimeExplosiveEvent.Post
,PrimeExplosiveEvent.Pre
,ProvideServiceEvent<T>
,ProvideServiceEvent.EngineScoped<T>
,ProvideServiceEvent.GameScoped<T>
,QueryServerEvent
,QueryServerEvent.Basic
,QueryServerEvent.Full
,RconConnectionEvent
,RconConnectionEvent.Auth
,RconConnectionEvent.Connect
,RconConnectionEvent.Disconnect
,RefreshGameEvent
,RegisterBuilderEvent
,RegisterChannelEvent
,RegisterCommandEvent<C>
,RegisterDataEvent
,RegisterDataPackValueEvent<T>
,RegisterFactoryEvent
,RegisterRegistryEvent
,RegisterRegistryEvent.EngineScoped<E>
,RegisterRegistryEvent.GameScoped
,RegisterRegistryEvent.WorldScoped
,RegisterRegistryValueEvent
,RegisterRegistryValueEvent.EngineScoped<E>
,RegisterRegistryValueEvent.GameScoped
,RegisterRegistryValueEvent.WorldScoped
,ResourcePackStatusEvent
,RespawnPlayerEvent
,RespawnPlayerEvent.Post
,RespawnPlayerEvent.Recreate
,RespawnPlayerEvent.SelectWorld
,RideEntityEvent
,RideEntityEvent.Dismount
,RideEntityEvent.Mount
,RotateEntityEvent
,SaveWorldEvent
,SaveWorldEvent.Post
,SaveWorldEvent.Pre
,ServerSideConnectionEvent
,ServerSideConnectionEvent.Auth
,ServerSideConnectionEvent.Disconnect
,ServerSideConnectionEvent.Handshake
,ServerSideConnectionEvent.Join
,ServerSideConnectionEvent.Login
,SetAITargetEvent
,SleepingEvent
,SleepingEvent.Failed
,SleepingEvent.Finish
,SleepingEvent.Pre
,SleepingEvent.Tick
,SpawnEntityEvent
,SpawnEntityEvent.Custom
,SpawnEntityEvent.Pre
,StartedEngineEvent<E>
,StartingEngineEvent<E>
,StoppedGameEvent
,StoppingEngineEvent<E>
,SubjectDataUpdateEvent
,TameEntityEvent
,TickBlockEvent
,TickBlockEvent.Random
,TickBlockEvent.Scheduled
,TransferInventoryEvent
,TransferInventoryEvent.Post
,TransferInventoryEvent.Pre
,UnleashEntityEvent
,UnloadWorldEvent
,UpdateAnvilEvent
,UseItemStackEvent
,UseItemStackEvent.Finish
,UseItemStackEvent.Replace
,UseItemStackEvent.Reset
,UseItemStackEvent.Start
,UseItemStackEvent.Stop
,UseItemStackEvent.Tick
- All Known Implementing Classes:
AbstractAffectEntityEvent
,AbstractAttackEntityEvent
,AbstractChangeEntityEquipmentEvent
,AbstractDamageEntityEvent
,AbstractDetonateEvent
,AbstractEvent
,AbstractGoalEvent
,AbstractModifierEvent
,AbstractSpawnEntityEvent
,AbstractValueChangeEvent
@DoNotStore public interface Event
An event called within Sponge.This is a marker interface, which must be implemented by any event used with the Sponge event bus.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Cause
cause()
Gets the cause for the event.default EventContext
context()
Gets the context of the event.default Object
source()
Gets the source of the event (the first object in the cause).
-
-
-
Method Detail
-
cause
Cause cause()
Gets the cause for the event. The Cause of the event is an object which implements the Iterable interface. So, when investigating the Cause of the event a common idiom is to use operations (functions) on the result of cause as follows: Use-case: Getting the Player (if any) responsible:Optional<Player> optPlayer = event.cause().first(Player.class);
- Returns:
- The cause
-
source
default Object source()
Gets the source of the event (the first object in the cause).- Returns:
- The event source
-
context
default EventContext context()
Gets the context of the event.- Returns:
- The event context
-
-