Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 2.29 KB

How to use Datapack Generation.md

File metadata and controls

57 lines (40 loc) · 2.29 KB

If you want to use Datapack's to generate a custom World you can use the following Methods to use them with the API.

Currently there are only 3 Methods you can use to import Datapack-Configurations:

Where to use those Methods:

DataPackResolver resolver = AdvancedWorldCreatorAPI.getDataPackResolver();
resolver.getStructureFeature...
resolver.getWorldGenFeature...
resolver.getBiome...

StructureFeatures:

getStructureFeature(String prekey, String name)
Vanilla Examples: Stronghold, Fortress, Villages
Add to your Custom Biome with: addCustomWorldStructureFeature(StructureFeature)

WorldGenFeatures:

getWorldGenFeature(String prekey, String name)
Vanilla Examples: Diamond-Ore, Jungle Tree, Flowers
Add to your Custom Biome with: addWorldGenDecorationFeature(WorldGenFeature)

Biomes:

getBiome(String prekey, String name)
Vanilla Examples: Plains, Desert, Ocean
Add to your Biome Generator with: addBiome(Biome<,...>)

Getting Prekey and Name

The Prekey is the Namespace of a MinecraftKey. Vanilla-Default: 'minecraft'
The Name is the Key of a MinecraftKey. Vanilla-Default: 'Plains', 'Desert', 'spring_lava'

In Datapack's the Prekey is a part of the path to the configuration:
For example: world\datapacks\MyDatapack\data\custom_name\worldgen\biome\mycustom_datapack_biome.json
Prekey: custom_name
Name: mycustom_datapack_biome

If you have sub-folders in the specific folders you have to add them to the Name.
For example: world\datapacks\MyDatapack\data\custom_name\worldgen\biome\sub_one_folder\mycustom_datapack_biome.json
Prekey: custom_name
Name: sub_one_folder/mycustom_datapack_biome

Other Methods:

getListedStructureFeatures()
getListedWorldGenFeature()
getListedBiomes()

They will return a List of MinecraftKey's, so for example you could add all listed GenFeatures with the MinecraftKey-Namespace as Prekey and the MinecraftKey-Key as Name.

Notice: Not all Features are listed and sometimes new show up randomly without changing anything in the world. Those Methods are mostly useful when searching new Features.