Class CreateSpawnerEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.spawning.CreateSpawnerEvent
public class CreateSpawnerEvent
extends net.minecraftforge.eventbus.api.Event
Fires when a spawner is built off a preset. Provided custom spawner builders fire the super.apply(T)
after all of its applications, this event will fire at the very end of a spawner's construction and
therefore any and all changes made during a handle of this event will be final.
This event should be used to modify the properties of spawners. For example, one could check whether
spawner
is an instance of PlayerTrackingSpawner
, and if it is and it belongs to a
specific player, double the TickingSpawner.capacity
field. This would give the result of a player
having a larger number of Pokémon capable of existing around them at once. As previously mentioned,
these fields are final (unless custom code changes them) at the time of this event firing, so there is
no need to monitor these fields after the changes have been made.
-
Nested Class Summary
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
Modifier and TypeFieldDescriptionfinal AbstractSpawner.SpawnerBuilder<? extends AbstractSpawner>
TheAbstractSpawner.SpawnerBuilder
being used.final AbstractSpawner
TheAbstractSpawner
being created. -
Constructor Summary
ConstructorDescriptionCreateSpawnerEvent
(AbstractSpawner spawner, AbstractSpawner.SpawnerBuilder<? extends AbstractSpawner> builder) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
spawner
TheAbstractSpawner
being created. The spawner is final, but its properties are not. -
builder
TheAbstractSpawner.SpawnerBuilder
being used. Its properties could be modified from here, but shouldn't be needed.
-
-
Constructor Details
-
CreateSpawnerEvent
public CreateSpawnerEvent(AbstractSpawner spawner, AbstractSpawner.SpawnerBuilder<? extends AbstractSpawner> builder)
-