Class LegendarySpawnEvent.ChoosePlayer

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent
com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent.ChoosePlayer
Enclosing class:
LegendarySpawnEvent

public static class LegendarySpawnEvent.ChoosePlayer extends LegendarySpawnEvent
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.

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent

    LegendarySpawnEvent.ChoosePlayer, LegendarySpawnEvent.DoSpawn

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final ArrayList<ArrayList<net.minecraft.server.level.ServerPlayer>>
    The clusters of players that are considered during selection.
    net.minecraft.server.level.ServerPlayer
    The player to potentially spawn a legendary near.

    Fields inherited from class com.pixelmonmod.pixelmon.api.events.spawning.LegendarySpawnEvent

    spawner
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChoosePlayer(LegendarySpawner spawner, net.minecraft.server.level.ServerPlayer player, ArrayList<ArrayList<net.minecraft.server.level.ServerPlayer>> clusters)
     
  • Method Summary

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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)