Class PixelmonSpawnerEvent

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

public class PixelmonSpawnerEvent extends net.minecraftforge.eventbus.api.Event
This class contains all the relevant events to when a Pixelmon spawner block attempts to/successfully spawn(s) a Pokemon
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This is the post-pixelmon spawn event fired after the entity is spawned and after the Pokemon is created from the specification This is where you can modify the pokemon/entity that has been spawned This is not cancellable
    static class 
    This is the pre-pixelmon spawn event fired before the entity is spawned and before the Pokemon is created from the specification Cancelling this will prevent the entity from being spawned

    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
     
    protected net.minecraft.core.BlockPos
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PixelmonSpawnerEvent(PixelmonSpawnerTileEntity spawner, PokemonSpecification spec, net.minecraft.core.BlockPos spawnPosition)
    The basic constructor for the event
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.Level
    Gets the level that the pokemon is/will spawn in
    Gets the spawner tile entity causing the pokemon to spawn
    net.minecraft.core.BlockPos
    Gets the block position of the spawner
    net.minecraft.world.level.block.state.BlockState
    Gets the block state of the spawner
    net.minecraft.core.BlockPos
    Gets the spawn position of the Pokemon
    Gets the specification of the Pokemon spawning

    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

  • 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