Class PlayerLifecycleEvents
java.lang.Object
net.timtaran.interactivemc.event.player.PlayerLifecycleEvents
Handles player lifecycle events such as joining, respawning, and leaving the game.
This class listens to player lifecycle events and manages the creation and removal of player bodies in the physics world accordingly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Initializes and registers all player lifecycle event listeners.static voidremovePlayer(net.minecraft.world.entity.player.Player player) Removes player bodies when a player leaves the game.static voidspawnPlayer(net.minecraft.world.entity.player.Player player) Spawns player bodies when a player joins or respawns.
-
Method Details
-
init
public static void init()Initializes and registers all player lifecycle event listeners. -
spawnPlayer
public static void spawnPlayer(net.minecraft.world.entity.player.Player player) Spawns player bodies when a player joins or respawns.- Parameters:
player- the player that joined or respawned
-
removePlayer
public static void removePlayer(net.minecraft.world.entity.player.Player player) Removes player bodies when a player leaves the game.- Parameters:
player- the player that left
-