Class PlayerSpawnEvent

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

public class PlayerSpawnEvent extends Object implements PlayerEvent
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 public @NotNull Instance getSpawnInstance()
      Gets the entity 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