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
-
Nested Class Summary
Nested ClassesModifier 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 spawned -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PixelmonSpawnerTileEntity
protected net.minecraft.core.BlockPos
protected PokemonSpecification
-
Constructor Summary
ConstructorsConstructorDescriptionPixelmonSpawnerEvent
(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 spawning
-
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
-