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
Modifier and TypeClassDescriptionstatic 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 cancellablestatic 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 spawnedNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected final PixelmonSpawnerTileEntity
protected net.minecraft.core.BlockPos
protected PokemonSpecification
-
Constructor Summary
ConstructorDescriptionPixelmonSpawnerEvent
(PixelmonSpawnerTileEntity spawner, PokemonSpecification spec, net.minecraft.core.BlockPos spawnPosition) The basic constructor for the event -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.Level
getLevel()
Gets the level that the pokemon is/will spawn inGets the spawner tile entity causing the pokemon to spawnnet.minecraft.core.BlockPos
Gets the block position of the spawnernet.minecraft.world.level.block.state.BlockState
Gets the block state of the spawnernet.minecraft.core.BlockPos
Gets the spawn position of the PokemongetSpec()
Gets the specification of the Pokemon spawningMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
spawner
-
spec
-
spawnPosition
protected net.minecraft.core.BlockPos spawnPosition
-
-
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 entityspec
- The specification of the spawned pokemonspawnPosition
- The spawn position of the pokemon
-
-
Method Details
-
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
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
-