How to register a class that contains events?

This isn’t working for some reason.

Primary.java
AllEvents.java

InventoryClickEvent, along with many other events, is not currently fired.

Thanks for the info. Am I registering it right atleast?

game.getEventManager().register(plugin, AllEvents.getInstance());

This is right but I don’t see a plugin variable. Just use this

Did you even bother reading the documentation?
https://docs.spongepowered.org/en/plugin/basics/events.html

“For event handlers on your main plugin class, you do not need to register the object for events because Sponge will do it automatically.”

RTFM!!!

The point was that he was listening for events in a different class (not annotated by @Plugin), so your comment does not apply.

That’s fair, but either way he still could’ve read the docs before resorting here. His problem was easily solvable. He should also know that it’s still in-development. I’m just saying it was quite a lazy move, he could’ve done a little more searching

There are multiple ways of doing registering events and as a matter of fact, I have read the “outdated” doc which showed that registering events is done by services. Since I found that function, I wanted to know if it is going to work. It has nothing to do with the doc so try getting your facts straight next time bud.

Alright. Will test that out. Is there a way I can find out what sort of events or functions is actually implemented?