Closed ghost closed 7 years ago
It doesn't matter what the method name is, just make sure you use the @EventHandler
annotation and the only parameter of your method is ChatEvent
.
...really? I'm interested now how that is implemented by the mod, does it just try to find the method with that signature?
Thanks though :)
Yes, exactly. It is all done using reflection and inspired by the event system in Forge and Bukkit.
I've searched this repository for phrases like
onChat
and can't find the event handler that allows me to receive a chat event.I can find the
ChatEvent
class, which I'm guessing is what this method will be passed, but I can't find the method itself.What
@EventHandler
method do I have to define in my main function to be able to handle chat events?