Interface BiomeModificationContext.MobSpawnSettingsContext

Enclosing interface:
BiomeModificationContext

public static interface BiomeModificationContext.MobSpawnSettingsContext
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMobCharge(net.minecraft.world.entity.EntityType<?> entityType, double charge, double energyBudget)
    Associated JSON property: spawn_costs.
    void
    addSpawn(net.minecraft.world.entity.MobCategory category, net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData data, int weight)
    Associated JSON property: spawners.
    void
    clearMobCharge(net.minecraft.world.entity.EntityType<?> entityType)
    Removes a spawn cost entry for a given entity type.
    default void
    Removes all spawns.
    default void
    clearSpawns(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.
    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.
    default boolean
    removeSpawnsOfEntityType(net.minecraft.world.entity.EntityType<?> entityType)
    Removes all spawns of the given entity type.
    void
    Associated JSON property: creature_spawn_probability.
  • Method Details

    • setCreatureGenerationProbability

      void setCreatureGenerationProbability(float probability)
      Associated JSON property: creature_spawn_probability.
      See Also:
      • MobSpawnSettings.getCreatureProbability()
      • MobSpawnSettings.Builder.creatureGenerationProbability(float)
    • 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:
      • MobSpawnSettings.getMobs(MobCategory)
    • 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:
      • MobSpawnSettings.getMobs(MobCategory)
      • MobSpawnSettings.Builder.addSpawn(MobCategory, int, MobSpawnSettings.SpawnerData)
    • 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:
      • MobSpawnSettings.getMobSpawnCost(EntityType)
      • MobSpawnSettings.Builder.addMobCharge(EntityType, double, double)
    • clearMobCharge

      void clearMobCharge(net.minecraft.world.entity.EntityType<?> entityType)
      Removes a spawn cost entry for a given entity type.

      Associated JSON property: spawn_costs.