Class PlayerSpawnEvent

java.lang.Object
net.minestom.server.event.player.PlayerSpawnEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent, PlayerEvent, PlayerInstanceEvent

public class PlayerSpawnEvent extends Object implements PlayerInstanceEvent
Called when a new instance is set for a player.
  • Constructor Details

    • PlayerSpawnEvent

      public PlayerSpawnEvent(@NotNull @NotNull Player player, @NotNull @NotNull Instance spawnInstance, boolean firstSpawn)
  • Method Details

    • getSpawnInstance

      @NotNull @Deprecated public @NotNull Instance getSpawnInstance()
      Deprecated.
      Gets the player's new instance.
      Returns:
      the instance
    • isFirstSpawn

      public boolean isFirstSpawn()
      'true' if the player is spawning for the first time. 'false' if this spawn event was triggered by a dimension teleport
      Returns:
      true if this is the first spawn, false otherwise
    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player