Interface BiomeModifier

All Known Implementing Classes:
BiomeModifiers.AddCarversBiomeModifier, BiomeModifiers.AddFeaturesBiomeModifier, BiomeModifiers.AddSpawnCostsBiomeModifier, BiomeModifiers.AddSpawnsBiomeModifier, BiomeModifiers.RemoveCarversBiomeModifier, BiomeModifiers.RemoveFeaturesBiomeModifier, BiomeModifiers.RemoveSpawnCostsBiomeModifier, BiomeModifiers.RemoveSpawnsBiomeModifier

public interface BiomeModifier
JSON-serializable biome modifier. Requires a Codec to deserialize biome modifiers from biome modifier jsons.

Biome modifier jsons have the following json format:

{
  "type": "yourmod:yourserializer", // Indicates a registered biome modifier serializer
  // Additional fields can be specified here according to the codec
}
  • Field Details

    • DIRECT_CODEC

      static final com.mojang.serialization.Codec<BiomeModifier> DIRECT_CODEC
      Codec for (de)serializing biome modifiers inline. Mods can use this for data generation.
    • REFERENCE_CODEC

      static final com.mojang.serialization.Codec<Holder<BiomeModifier>> REFERENCE_CODEC
      Codec for referring to biome modifiers by id in other datapack registry files. Can only be used with RegistryOps.
    • LIST_CODEC

      static final com.mojang.serialization.Codec<HolderSet<BiomeModifier>> LIST_CODEC
      Codec for referring to biome modifiers by id, list of id, or tags. Can only be used with RegistryOps.
  • Method Details

    • modify

      void modify(RegistryAccess registries, Holder<Biome> biome, BiomeModifier.Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder)

      Modifies the information via the provided biome builder.

      Allows mob spawns and world-gen features to be added or removed, and climate and client effects to be modified.

      Parameters:
      registries - the registries
      biome - the named biome being modified (with original data readable)
      phase - the biome modification phase; biome modifiers apply in each phase in order of the enum constants
      builder - mutable biome info builder
    • codec

      com.mojang.serialization.MapCodec<? extends BiomeModifier> codec()
      Returns:
      the codec which serializes and deserializes this biome modifier