Interface BiomeModificationContext.MobSpawnSettingsContext
- Enclosing interface:
BiomeModificationContext
public static interface BiomeModificationContext.MobSpawnSettingsContext
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddMobCharge(net.minecraft.world.entity.EntityType<?> entityType, double charge, double energyBudget) Associated JSON property:spawn_costs.voidaddSpawn(net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData data, int weight) Associated JSON property:spawners.voidclearMobCharge(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 category) Removes all spawns of the given category.@UnmodifiableView List<net.minecraft.util.random.Weighted<net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData>> getMobs(net.minecraft.world.entity.MobCategory category) Provides a view of all spawns of the given category.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.voidsetCreatureGenerationProbability(float probability) Associated JSON property:creature_spawn_probability.
-
Method Details
-
setCreatureGenerationProbability
void setCreatureGenerationProbability(float probability) Associated JSON property:creature_spawn_probability.- See Also:
-
getMobs
@UnmodifiableView List<net.minecraft.util.random.Weighted<net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData>> getMobs(net.minecraft.world.entity.MobCategory category) Provides a view of all spawns of the given category.Associated JSON property:
spawners.- See Also:
-
addSpawn
void addSpawn(net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData data, 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 category) Removes all spawns of the given category.Associated JSON property:
spawners. -
clearSpawns
default void clearSpawns()Removes all spawns.Associated JSON property:
spawners. -
addMobCharge
void addMobCharge(net.minecraft.world.entity.EntityType<?> entityType, double charge, double energyBudget) Associated JSON property:spawn_costs.- See Also:
-
clearMobCharge
void clearMobCharge(net.minecraft.world.entity.EntityType<?> entityType) Removes a spawn cost entry for a given entity type.Associated JSON property:
spawn_costs.
-