Class PlayerSetSpawnEvent


public class PlayerSetSpawnEvent extends PlayerEvent
This event is fired when a player's spawn point is set or reset.
The event can be canceled, which will prevent the spawn point from being changed.
  • Field Details

    • spawnWorld

      private final ResourceKey<Level> spawnWorld
    • forced

      private final boolean forced
    • newSpawn

      @Nullable private final BlockPos newSpawn
  • Constructor Details

  • Method Details

    • isForced

      public boolean isForced()
    • getNewSpawn

      @Nullable public BlockPos getNewSpawn()
      The new spawn position, or null if the spawn position is being reset.
    • getSpawnWorld

      public ResourceKey<Level> getSpawnWorld()