Class TriggerSpawner
java.lang.Object
com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
com.pixelmonmod.pixelmon.api.spawning.archetypes.spawners.TriggerSpawner
A spawner that only does spawning when "triggered". This is a very simple implementation, and only
adds a chance and helper functions for wherever the spawner is triggered. External moves and fishing
are examples of areas that create and use trigger spawners, doing so without extending further.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
AbstractSpawner.SpawnerBuilder<T extends AbstractSpawner>
-
Field Summary
Modifier and TypeFieldDescriptionfloat
The chance that callingtrigger(SpawnLocation)
will succeed.Fields inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
cacheSets, checkSpawns, conditions, isBusy, lastSpawnTime, name, rarityMultipliers, rarityTweaks, selectionAlgorithm, spawnedTracker, spawnSets, tweaks
-
Constructor Summary
ConstructorDescriptionTriggerSpawner
(String name) TriggerSpawner
(String name, float triggerChance) -
Method Summary
Modifier and TypeMethodDescriptionSpawnAction<? extends net.minecraft.world.entity.Entity>
getAction
(SpawnLocation location, float triggerChance) GetsSpawnAction
for this location and chance, if possible.net.minecraft.world.entity.Entity
trigger
(SpawnLocation location) Triggers the spawner, causing it to check thetriggerChance
, attempt to find a suitableSpawnInfo
, then return the created entity.Methods inherited from class com.pixelmonmod.pixelmon.api.spawning.AbstractSpawner
calculateSpatialData, fits, getCondition, getSuitableSpawns, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak, shouldDoSpawning
-
Field Details
-
triggerChance
public float triggerChanceThe chance that callingtrigger(SpawnLocation)
will succeed. Defaults to 1 (guaranteed trigger).
-
-
Constructor Details
-
TriggerSpawner
-
TriggerSpawner
-
-
Method Details
-
trigger
Triggers the spawner, causing it to check thetriggerChance
, attempt to find a suitableSpawnInfo
, then return the created entity. -
getAction
public SpawnAction<? extends net.minecraft.world.entity.Entity> getAction(SpawnLocation location, float triggerChance) GetsSpawnAction
for this location and chance, if possible. This does not spawn the entity.
-