Package net.fabricmc.fabric.api.biome.v1
Interface BiomeModificationContext.SpawnSettingsContext
- Enclosing interface:
BiomeModificationContext
public static interface BiomeModificationContext.SpawnSettingsContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddSpawn(net.minecraft.world.entity.MobCategory spawnGroup, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawnEntry, int weight) Associated JSON property:spawners.voidclearSpawnCost(net.minecraft.world.entity.EntityType<?> entityType) Removes a spawn cost entry for a given entity type.default voidRemoves all spawns.default voidclearSpawns(net.minecraft.world.entity.MobCategory group) Removes all spawns of the given spawn group.@UnmodifiableView List<net.minecraft.util.random.Weighted<net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData>> getSpawnEntries(net.minecraft.world.entity.MobCategory spawnGroup) Provides a view of all spawns of the given spawn group.booleanremoveSpawns(BiPredicate<net.minecraft.world.entity.MobCategory, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData> predicate) Removes any spawns matching the given predicate from this biome, and returns true if any matched.default booleanremoveSpawnsOfEntityType(net.minecraft.world.entity.EntityType<?> entityType) Removes all spawns of the given entity type.voidsetCreatureSpawnProbability(float probability) Associated JSON property:creature_spawn_probability.voidsetSpawnCost(net.minecraft.world.entity.EntityType<?> entityType, double mass, double gravityLimit) Associated JSON property:spawn_costs.
-
Method Details
-
setCreatureSpawnProbability
void setCreatureSpawnProbability(float probability) Associated JSON property:creature_spawn_probability.- See Also:
-
getSpawnEntries
@UnmodifiableView List<net.minecraft.util.random.Weighted<net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData>> getSpawnEntries(net.minecraft.world.entity.MobCategory spawnGroup) Provides a view of all spawns of the given spawn group.Associated JSON property:
spawners.- See Also:
-
addSpawn
void addSpawn(net.minecraft.world.entity.MobCategory spawnGroup, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData spawnEntry, int weight) Associated JSON property:spawners.- See Also:
-
removeSpawns
boolean removeSpawns(BiPredicate<net.minecraft.world.entity.MobCategory, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData> predicate) Removes any spawns matching the given predicate from this biome, and returns true if any matched.Associated JSON property:
spawners. -
removeSpawnsOfEntityType
default boolean removeSpawnsOfEntityType(net.minecraft.world.entity.EntityType<?> entityType) Removes all spawns of the given entity type.Associated JSON property:
spawners.- Returns:
- True if any spawns were removed.
-
clearSpawns
default void clearSpawns(net.minecraft.world.entity.MobCategory group) Removes all spawns of the given spawn group.Associated JSON property:
spawners. -
clearSpawns
default void clearSpawns()Removes all spawns.Associated JSON property:
spawners. -
setSpawnCost
void setSpawnCost(net.minecraft.world.entity.EntityType<?> entityType, double mass, double gravityLimit) Associated JSON property:spawn_costs.- See Also:
-
clearSpawnCost
void clearSpawnCost(net.minecraft.world.entity.EntityType<?> entityType) Removes a spawn cost entry for a given entity type.Associated JSON property:
spawn_costs.
-