Glowstone-Legacy icon indicating copy to clipboard operation
Glowstone-Legacy copied to clipboard

The Big List Of Events

Open SpaceManiac opened this issue 12 years ago • 16 comments

A list of all events and in what manner they are implemented in Glowstone. Events checked off here are emitted by Glowstone in what is believed to be all appropriate cases; other issues may document incompleteness or errors in the implementation of these events.

block:

  • [x] BlockBreakEvent
  • [ ] BlockBurnEvent
  • [x] BlockCanBuildEvent
  • [x] BlockDamageEvent
  • [ ] BlockDispenseEvent
  • [ ] ~~BlockEvent~~
  • [ ] BlockExpEvent
  • [ ] BlockFadeEvent
  • [ ] BlockFormEvent
  • [ ] BlockFromToEvent
  • [ ] BlockGrowEvent
  • [ ] BlockIgniteEvent
  • [ ] BlockMultiPlaceEvent
  • [ ] BlockPhysicsEvent
  • [ ] ~~BlockPistonEvent~~
  • [ ] BlockPistonExtendEvent
  • [ ] BlockPistonRetractEvent
  • [x] BlockPlaceEvent
  • [ ] BlockRedstoneEvent
  • [ ] BlockSpreadEvent
  • [ ] EntityBlockFormEvent
  • [ ] LeavesDecayEvent
  • [ ] NotePlayEvent
  • [ ] SignChangeEvent

enchant:

  • [ ] EnchantItemEvent
  • [ ] PrepareItemEnchantEvent

entity:

  • [ ] CreatureSpawnEvent
  • [ ] CreeperPowerEvent
  • [ ] EntityBreakDoorEvent
  • [ ] EntityChangeBlockEvent
  • [ ] EntityCombustByBlockEvent
  • [ ] EntityCombustByEntityEvent
  • [ ] EntityCombustEvent
  • [ ] EntityCreatePortalEvent
  • [ ] EntityDamageByBlockEvent
  • [ ] EntityDamageByEntityEvent
  • [ ] EntityDamageEvent
  • [ ] EntityDeathEvent
  • [ ] ~~EntityEvent~~
  • [ ] EntityExplodeEvent
  • [ ] EntityInteractEvent
  • [ ] EntityPortalEnterEvent
  • [ ] EntityPortalEvent
  • [ ] EntityPortalExitEvent
  • [ ] EntityRegainHealthEvent
  • [ ] EntityShootBowEvent
  • [ ] EntityTameEvent
  • [ ] EntityTargetEvent
  • [ ] EntityTargetLivingEntityEvent
  • [ ] EntityTeleportEvent
  • [ ] EntityUnleashEvent
  • [ ] ExpBottleEvent
  • [ ] ExplosionPrimeEvent
  • [ ] FoodLevelChangeEvent
  • [ ] HorseJumpEvent
  • [ ] ItemDespawnEvent
  • [ ] ItemSpawnEvent
  • [ ] PigZapEvent
  • [ ] PlayerDeathEvent
  • [ ] PlayerLeashEntityEvent
  • [ ] PotionSplashEvent
  • [ ] ProjectileHitEvent
  • [ ] ProjectileLaunchEvent
  • [ ] SheepDyeWoolEvent
  • [ ] SheepRegrowWoolEvent
  • [ ] SlimeSplitEvent

hanging:

  • [ ] HangingBreakByEntityEvent
  • [ ] HangingBreakEvent
  • [ ] ~~HangingEvent~~
  • [ ] HangingPlaceEvent

inventory:

  • [ ] BrewEvent
  • [ ] CraftItemEvent
  • [ ] FurnaceBurnEvent
  • [ ] FurnaceExtractEvent
  • [ ] FurnaceSmeltEvent
  • [x] InventoryClickEvent
  • [ ] InventoryCloseEvent
  • [ ] InventoryCreativeEvent
  • [x] InventoryDragEvent
  • [ ] InventoryEvent (not abstract)
  • [ ] ~~InventoryInteractEvent~~
  • [ ] InventoryMoveItemEvent
  • [ ] InventoryOpenEvent
  • [ ] InventoryPickupItemEvent
  • [ ] PrepareItemCraftEvent

player:

  • [x] AsyncPlayerChatEvent
  • [x] AsyncPlayerPreLoginEvent
  • [x] PlayerAchievementAwardedEvent
  • [x] PlayerAnimationEvent
  • [ ] PlayerBedEnterEvent
  • [ ] PlayerBedLeaveEvent
  • [x] PlayerBucketEmptyEvent
  • [ ] ~~PlayerBucketEvent~~
  • [x] PlayerBucketFillEvent
  • [x] PlayerChangedWorldEvent
  • [x] ~~PlayerChannelEvent~~
  • [x] PlayerChatEvent
  • [x] PlayerChatTabCompleteEvent
  • [x] PlayerCommandPreprocessEvent
  • [x] PlayerDropItemEvent
  • [ ] PlayerEditBookEvent
  • [ ] PlayerEggThrowEvent
  • [ ] ~~PlayerEvent~~
  • [ ] PlayerExpChangeEvent
  • [ ] PlayerFishEvent
  • [x] PlayerGameModeChangeEvent
  • [ ] PlayerInteractEntityEvent
  • [x] PlayerInteractEvent
  • [ ] ~~PlayerInventoryEvent~~
  • [x] PlayerItemBreakEvent
  • [ ] PlayerItemConsumeEvent
  • [x] PlayerItemHeldEvent
  • [x] PlayerJoinEvent
  • [x] PlayerKickEvent
  • [ ] PlayerLevelChangeEvent
  • [x] PlayerLoginEvent
  • [x] PlayerMoveEvent
  • [ ] PlayerPickupItemEvent
  • [x] PlayerPortalEvent
  • [x] PlayerPreLoginEvent
  • [x] PlayerQuitEvent
  • [x] PlayerRegisterChannelEvent
  • [x] PlayerRespawnEvent
  • [ ] PlayerShearEntityEvent
  • [ ] PlayerStatisticIncrementEvent
  • [x] PlayerTeleportEvent
  • [ ] PlayerToggleFlightEvent
  • [x] PlayerToggleSneakEvent
  • [x] PlayerToggleSprintEvent
  • [ ] PlayerUnleashEntityEvent
  • [x] PlayerUnregisterChannelEvent
  • [x] PlayerVelocityEvent

server:

  • [ ] MapInitializeEvent
  • [x] PluginDisableEvent
  • [x] PluginEnableEvent
  • [x] ~~PluginEvent~~
  • [x] RemoteServerCommandEvent
  • [x] ServerCommandEvent
  • [ ] ~~ServerEvent~~
  • [x] ServerListPingEvent
  • [x] ~~ServiceEvent~~
  • [x] ServiceRegisterEvent
  • [x] ServiceUnregisterEvent

vehicle:

  • [ ] VehicleBlockCollisionEvent
  • [ ] ~~VehicleCollisionEvent~~
  • [ ] VehicleCreateEvent
  • [ ] VehicleDamageEvent
  • [ ] VehicleDestroyEvent
  • [ ] VehicleEnterEvent
  • [ ] VehicleEntityCollisionEvent
  • [ ] ~~VehicleEvent~~
  • [ ] VehicleExitEvent
  • [ ] VehicleMoveEvent
  • [ ] VehicleUpdateEvent

weather:

  • [x] LightningStrikeEvent
  • [x] ThunderChangeEvent
  • [x] WeatherChangeEvent
  • [x] ~~WeatherEvent~~

world:

  • [ ] ~~ChunkEvent~~
  • [x] ChunkLoadEvent
  • [x] ChunkPopulateEvent
  • [x] ChunkUnloadEvent
  • [ ] PortalCreateEvent
  • [x] SpawnChangeEvent
  • [x] StructureGrowEvent
  • [ ] ~~WorldEvent~~
  • [x] WorldInitEvent
  • [x] WorldLoadEvent
  • [x] WorldSaveEvent
  • [x] WorldUnloadEvent

SpaceManiac avatar Jul 20 '11 07:07 SpaceManiac

@SpaceManiac ChunkEvent, WorldEvent, WeatherEvent, VehicleEvent, PluginEvent, PlayerEvent, InventoryEvent, HangingEvent and BlockEvent. Are all abstract superclasses of the related type. They cannot be called directly.

JeromSar avatar Sep 13 '14 16:09 JeromSar

@SpaceManiac ThunderChangeEvent and WeatherChangeEvent are already implemented.

Edit: So are the following events.

  • PlayerJoinEvent
  • PlayerKickEvent
  • PlayerQuitEvent

JeromSar avatar Sep 13 '14 16:09 JeromSar

@SpaceManiac @turt2live bunch of checkboxes ready to be checked here

Also check AsyncPlayerChatEvent

dequis avatar Sep 18 '14 10:09 dequis

Hi, I have a question: why are events like BlockEvent abstract classes? It might be useful to use them if, for instance, I need to react to each possible event triggered by a block. I know this is not how it is implemented in bukkit, but I see no harm in implementing it differently here since this would still guarantee compatibility, it's just an extension...

giampiero7 avatar Nov 11 '14 13:11 giampiero7

uhm, cant you just use the abstract class for your event listener?

2014-11-11 14:06 GMT+01:00 Giampiero [email protected]:

Hi, I have a question: why are events like BlockEvent abstract classes? It might be useful to use them if, for instance, I need to react to each possible event triggered by a block. I know this is not how it is implemented in bukkit, but I see no harm in implementing it differently here since this would still guarantee compatibility, it's just an extension...

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/28#issuecomment-62543923 .

Postremus avatar Nov 11 '14 13:11 Postremus

If I try using an @EventHandler with BlockEvent as parameter class, I get this exception:

org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.block.BlockEvent

Now that I tried it again, I'm considering that this exception might not be due to the fact that it is an abstract class... or maybe it is... anyway, my general point is that it should be possible to listen to such events... not really sure now what is the cause of the Exception

giampiero7 avatar Nov 11 '14 14:11 giampiero7

yeah, the blockevent has no handlerlist, as the exception says..

2014-11-11 15:13 GMT+01:00 Giampiero [email protected]:

If I try using an @EventHandler https://github.com/EventHandler with BlockEvent as parameter class, I get this exception:

org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.block.BlockEvent

Now that I tried it again, I'm considering that this exception might not be due to the fact that it is an abstract class... or maybe it is... anyway, my general point is that it should be possible to listen to such events... not really sure now what is the cause of the Exception

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/28#issuecomment-62551682 .

Postremus avatar Nov 11 '14 14:11 Postremus

Is it something that is going to be added?

giampiero7 avatar Nov 11 '14 15:11 giampiero7

What use case would warrant the change?

sent from mobile On Nov 11, 2014 8:29 AM, "Giampiero" [email protected] wrote:

Is is something that is going to be added?

— Reply to this email directly or view it on GitHub https://github.com/GlowstoneMC/Glowstone/issues/28#issuecomment-62563037 .

turt2live avatar Nov 11 '14 20:11 turt2live

I didn't see the implementation details of this, so I'm not sure if this exception is due to the fact that it is an abstract class, or just because blockevent has no handlerlist... which, in turn, I don't know if it is something that is supposed to be there (i.e. bukkit has it) or not... So, If this is just something that is not implemented yet, then there's actually no change to do... sorry for the useless comment... On the other hand, if this is actually something that bukkit does not provide, I see it as a useful feature in every case where you have to trigger the same logic on several events subclassing blockevent

giampiero7 avatar Nov 12 '14 08:11 giampiero7

Again, what use case would warrant the change? (Craft)Bukkit never provided the behaviour you described.

turt2live avatar Nov 12 '14 08:11 turt2live

I don't have a specific use case... I just see it as something handy to have... and I see no reason not to have it... As an example, if I'd need to compute a "cusom state" of a block which depends on several characteristic of the block, I might need to react to every event it triggers and run my logic to check the new state... Or even just for debugging purposes it can be useful...

giampiero7 avatar Nov 12 '14 09:11 giampiero7

The only reason why I ask is that it could cause new plugin developers confusion and headaches if they are allowed to listen to a generic event like that. Additionally it would fire a ridiculous amount of times once Glowstone is more complete.

A valid use case for doing so would help explain why a dramatic change such as that would be needed as all I see it doing is promoting bad code, bad practice, and performance concerns.

turt2live avatar Nov 12 '14 09:11 turt2live

Well, it was just a suggestion... the only personal use case I have is debugging :) About the performance, again, I don't know the implementation details, but I think there would be no impact if there are no listeners for it...

giampiero7 avatar Nov 12 '14 09:11 giampiero7

There is still a performance hit if there are no listeners. Ideally though no loss would occur.

turt2live avatar Nov 12 '14 09:11 turt2live

Glowstone++ has added:

  • BlockBurnEvent
  • BlockDispenseEvent
  • BlockFadeEvent
  • BlockFromToEvent
  • BlockGrowEvent
  • BlockIgniteEvent
  • BlockSpreadEvent
  • LeavesDecayEvent
  • CreatureSpawnEvent
  • FoodLevelChangeEvent
  • CraftItemEvent
  • FurnaceBurnEvent
  • FurnaceExtractEvent
  • FurnaceSmeltEvent
  • InventoryCloseEvent
  • InventoryCreativeEvent
  • PlayerBedEnterEvent
  • PlayerBedLeaveEvent
  • PlayerInteractEntityEvent
  • PlayerItemConsumeEvent

mastercoms avatar Mar 07 '16 16:03 mastercoms