Hello,
I’ve been trying to make events work in different classes.
So what I’m trying to do is to have my main file. And then a separate class with an event in it.
The code that I’m using doesn’t work. If someone could help me figuring this out.
public class Core {
@Subscribe
public void onInitialization(InitializationEvent e) {
Game.getEventManager().register(this, new PlayerJoin());
} }
It prints out the following error:
Cannot make a static reference to the non-static method getEventManager() from the type Game
I’m sort of new to Sponge coding so don’t judge ;-;.
Sincerely,
Jumperlow