public class TriggerSpawner extends AbstractSpawner
AbstractSpawner.SpawnerBuilder<T extends AbstractSpawner>
Modifier and Type | Field and Description |
---|---|
float |
triggerChance
The chance that calling
trigger(SpawnLocation) will succeed. |
cacheSets, checkSpawns, conditions, isBusy, lastSpawnTime, name, rarityMultipliers, rarityTweaks, selectionAlgorithm, spawnedTracker, spawnSets, tweaks
Constructor and Description |
---|
TriggerSpawner(java.lang.String name) |
TriggerSpawner(java.lang.String name,
float triggerChance) |
Modifier and Type | Method and Description |
---|---|
SpawnAction<? extends net.minecraft.entity.Entity> |
getAction(SpawnLocation location,
float triggerChance)
Gets
SpawnAction for this location and chance, if possible. |
net.minecraft.entity.Entity |
trigger(SpawnLocation location)
Triggers the spawner, causing it to check the
triggerChance ,
attempt to find a suitable SpawnInfo , then return the created entity. |
calculateSpatialData, fits, getCondition, getSuitableSpawns, getTrackedBlockCollection, getTweak, getWeightedSpawnInfo, hasCondition, hasTweak, shouldDoSpawning
public float triggerChance
trigger(SpawnLocation)
will succeed. Defaults to 1 (guaranteed trigger).public TriggerSpawner(java.lang.String name)
public TriggerSpawner(java.lang.String name, float triggerChance)
@Nullable public net.minecraft.entity.Entity trigger(SpawnLocation location)
triggerChance
,
attempt to find a suitable SpawnInfo
, then return the created entity.public SpawnAction<? extends net.minecraft.entity.Entity> getAction(SpawnLocation location, float triggerChance)
SpawnAction
for this location and chance, if possible. This does not spawn the entity.