Hello, for a part of a mod I'm working on I need to send a chat message to the player. Originally the method is called when forge loads up and since the player isn't in the world yet it returns null and crashes the whole thing. So what I need is a way to call a function from a mod file that is run as soon as the player enters the world. Thanks in advance.
Hello, for a part of a mod I'm working on I need to send a chat message to the player. Originally the method is called when forge loads up and since the player isn't in the world yet it returns null and crashes the whole thing. So what I need is a way to call a function from a mod file that is run as soon as the player enters the world. Thanks in advance.
Enters a specific world, or just enters a server? If it's just when a player joins a server (keep in mind, Minecraft is always run as a server now since the LAN integration) you can create a file that implements IPlayerTracker and register it with the Game Registry. In that, there's an onPlayerLogin method.
Ok so I set it up to work but I did a System.out.println test and it didnt show up. So my questions now is how do i set it so that it will be called whent he world loads.
Enters a specific world, or just enters a server? If it's just when a player joins a server (keep in mind, Minecraft is always run as a server now since the LAN integration) you can create a file that implements IPlayerTracker and register it with the Game Registry. In that, there's an onPlayerLogin method.