Events
Everything about events.
Custom Events
PlayerAnchorDeathEvent
This event is triggered when a player dies from a detonated Respawn Anchor. It provides information about the block, the player that died and the player who detonated the Respawn Anchor.
There are plans to let you change the death message, etc just like in PlayerCrystalDeathEvent
attacker()
- Retrieves the Respawn Anchors detonator.victim()
- Retrieves the player that died to the Respawn Anchor explosion detonated by the attacker.anchor()
- Retrieves the (already exploded) Respawn Anchorblock()
- Retrieves theBlockState
of the nullable block.
PlayerCrystalDeathEvent
This event is triggered when a player dies from a destroyed end crystal. It provides information about the end crystal, the player that died and the player who destroyed the end crystal.
This class lets you change the death message, etc.
killer()
- Retrieves the End Crystals destroyer.victim()
- Retrieves the player that died to the End Crystal explosion caused by the killer/attacker.crystal()
- Retrieves the End Crystal associated with this event.
Abstract Event Listener
This is a easy way to automatically register your event listeners.
This currently only supports one singular event per class.
Let's make a PlayerJoinEvent
listener.
Event Builder
The EventBuilder
is an easy way to create a event listener without creating any new methods, instead by just using a Consumer.
Let's also make a PlayerJoinEvent
listener.
execute(Consumer<E>)
- What should be ran when listening to a event.build()
- Returns theEventHandler<E>
which configures your event listener options.ignoreCancelled(boolean)
- Sets whether cancelled events should be ignored.priority(int)
- Sets the event priority.register()
- Finally registers the event.
PluginWrapper
Events
PluginWrapper
EventsIn PluginWrapper
you will find a events()
method which returns PluginEvents
. It's an alternative to the PluginManager
.
Here's the example PlayerJoinEvent
listener.
Last updated
Was this helpful?