Class PixelmonSpawnerEvent

java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.spawning.PixelmonSpawnerEvent
Direct Known Subclasses:
PixelmonSpawnerEvent.Post, PixelmonSpawnerEvent.Pre

public class PixelmonSpawnerEvent extends net.neoforged.bus.api.Event
This class contains all the relevant events to when a Pixelmon spawner block attempts to/successfully spawn(s) a Pokemon
  • Field Details

  • Constructor Details

    • PixelmonSpawnerEvent

      public PixelmonSpawnerEvent(PixelmonSpawnerTileEntity spawner, PokemonSpecification spec, net.minecraft.core.BlockPos spawnPosition)
      The basic constructor for the event
      Parameters:
      spawner - The relevant tile entity
      spec - The specification of the spawned pokemon
      spawnPosition - The spawn position of the pokemon
  • Method Details

    • getSpawner

      public PixelmonSpawnerTileEntity getSpawner()
      Gets the spawner tile entity causing the pokemon to spawn
      Returns:
      The tile entity
    • getSpawnerPosition

      public net.minecraft.core.BlockPos getSpawnerPosition()
      Gets the block position of the spawner
      Returns:
      The spawner block position
    • getSpawnerState

      public net.minecraft.world.level.block.state.BlockState getSpawnerState()
      Gets the block state of the spawner
      Returns:
      The block state
    • getLevel

      public net.minecraft.world.level.Level getLevel()
      Gets the level that the pokemon is/will spawn in
      Returns:
      The level
    • getSpec

      public PokemonSpecification getSpec()
      Gets the specification of the Pokemon spawning
      Returns:
      The specification
    • getSpawnPosition

      public net.minecraft.core.BlockPos getSpawnPosition()
      Gets the spawn position of the Pokemon
      Returns:
      The spawn position