Class LegendarySpawnEvent.ChoosePlayer

java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent
com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent.ChoosePlayer
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
Enclosing class:
LegendarySpawnEvent

public static class LegendarySpawnEvent.ChoosePlayer extends LegendarySpawnEvent implements net.neoforged.bus.api.ICancellableEvent
Event fired when a LegendarySpawner has selected which player to spawn a legendary near. Which Pokémon will spawn has not been chosen at this point, and whether or not a legendary will spawn is not guaranteed. This is only for deciding where to look for a legendary spawn location.

The spawner included in this event is guaranteed to be a LegendarySpawner

Cancelling this event or making the player null will prevent a legendary spawn calculation from occurring.

  • Field Details

    • player

      public net.minecraft.server.level.ServerPlayer player
      The player to potentially spawn a legendary near. Changing this player is acceptable.
    • clusters

      public final ArrayList<ArrayList<net.minecraft.server.level.ServerPlayer>> clusters
      The clusters of players that are considered during selection. You might use this to perform your own calculation. Emptying a cluster's contents is safe, but not modifying the cluster list itself.
  • Constructor Details

    • ChoosePlayer

      public ChoosePlayer(LegendarySpawner spawner, net.minecraft.server.level.ServerPlayer player, ArrayList<ArrayList<net.minecraft.server.level.ServerPlayer>> clusters)