-
Notifications
You must be signed in to change notification settings - Fork 65
Events (v2)
For the V2, Negativity use a custom event system, to make events available for every platform (and not spigot events for spigot, and sponge events for sponge).
All events are located at com.elikill58.negativity.api.events
.
It works approximatly the same as spigot.
Firstly, you have to implement Listeners
.
Then, when you want to intercept an event, you have to create a method with only one argument : the needed event.
To this method, you have to add @EventListener
as @EventHandler
on spigot and @Listener
on sponge.
Finally, you have to register this class to Negativity event manager :
EventManager.registerEvent(myClass)
Yes. Negativity as all of his own events, as PlayerMoveEvent
, InventoryClickEvent
... and not only cheaters one.
You have to create a new class which implement Event.
Then call EventManager.callEvent(myEvent)
Welcome to Negativity's wiki !