Changes

2,605 bytes added ,  00:59, 15 June 2022
Add the four new stock biome modifiers and a datagen link
Line 139: Line 139:  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
= Datageneration =
 +
 +
Biome Modifier jsons can be [[Datageneration|datagenerated via GatherDataEvent]]. As biome modifiers are datapack registry objects, this can be done by using JsonCodecProvider#forDatapackRegistry as the data provider. Refer to [[Datageneration/Datapack_Registries]] for additional information on datagenerating datapack registry elements.
    
= Builtin Biome Modifier Types =
 
= Builtin Biome Modifier Types =
 +
 +
Forge provides the following builtin biome modifier types:
    
== None ==
 
== None ==
   −
Forge provides a no-op biome modifier type, whose jsons have the following format:
+
A no-op biome modifier type, whose jsons have the following format:
    
<syntaxhighlight lang="json">
 
<syntaxhighlight lang="json">
Line 153: Line 159:     
This allows pack devs or server operators to disable mods' biome modifiers by overriding their biome modifier jsons with the above.
 
This allows pack devs or server operators to disable mods' biome modifiers by overriding their biome modifier jsons with the above.
 +
 +
== Add Features ==
 +
 +
This biome modifier type adds placed features to biomes.
 +
 +
<syntaxhighlight lang="json">
 +
{
 +
  "type": "forge:add_features", // required
 +
  "biomes": "#namespace:your_biome_tag" // accepts a biome id, [list of biome ids], or #namespace:biome_tag
 +
  "features": "namespace:your_feature", // accepts a placed feature id, [list of placed feature ids], or #namespace:feature_tag
 +
  "step": "underground_ores" // accepts a Decoration enum name
 +
}
 +
</syntaxhighlight>
 +
 +
Decoration steps in order of generation are:
 +
* raw_generation
 +
* lakes
 +
* local_modifications
 +
* underground_structures
 +
* surface_structures
 +
* underground_ores
 +
* underground_decoration
 +
* fluid_springs
 +
* vegetal_decoration
 +
* top_layer_modification
 +
 +
== Remove Features ==
 +
 +
This biome modifier type removes features from biomes.
 +
 +
<syntaxhighlight lang="json">
 +
{
 +
  "type": "forge:remove_features", // required
 +
  "biomes": "#namespace:your_biome_tag" // accepts a biome id, [list of biome ids], or #namespace:biome_tag
 +
  "features": "namespace:your_feature", // accepts a placed feature id, [list of placed feature ids], or #namespace:feature_tag
 +
  "steps": "underground_ores" // optional field specifying a Decoration or list of Decorations to remove features from, defaults to all if not specified
 +
}
 +
</syntaxhighlight>
 +
 +
== Add Spawns ==
 +
 +
This biome modifier type adds mob spawns to biomes.
 +
 +
<syntaxhighlight lang="json">
 +
{
 +
  "type": "forge:add_spawn", // Required
 +
  "biomes": "#namespace:biome_tag", // Accepts a biome id, [list of biome ids], or #namespace:biome_tag
 +
  "spawner":
 +
  {
 +
    "type": "namespace:entity_type", // Type of mob to spawn
 +
    "weight": 100, // int, spawn weighting
 +
    "minCount": 1, // int, minimum pack size
 +
    "maxCount": 4, // int, maximum pack size
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 +
== Remove Spawns ==
 +
 +
This biome modifier type removes mob spawns from biomes.
 +
 +
<syntaxhighlight lang="json">
 +
{
 +
  "type": "forge:add_spawn", // Required
 +
  "biomes": "#namespace:biome_tag", // Accepts a biome id, [list of biome ids], or #namespace:biome_tag
 +
  "entity_types": "#namespace:entitytype_tag" // Accepts an entity type, list, or tag of entitytypes whose spawns are to be removed from the biomes
 +
}
 +
</syntaxhighlight>
    
= Best Practices =
 
= Best Practices =
    
* Avoid using biome modifiers to add vanilla placed features to biomes, as this may cause a feature cycle violation (the game will crash if two biomes have the same two features in their feature lists but in different orders). Placed features can be referenced in biome jsons or added via biome modifiers, but should not be used in both.
 
* Avoid using biome modifiers to add vanilla placed features to biomes, as this may cause a feature cycle violation (the game will crash if two biomes have the same two features in their feature lists but in different orders). Placed features can be referenced in biome jsons or added via biome modifiers, but should not be used in both.
22

edits