Skip to content

Adding Spheres (Advanced)

DaFuqs edited this page Dec 12, 2022 · 1 revision

Mastered the way of adding new spheres? Here are some additional customisaton options.

Here is one of the compat recipes for mod ores, namely starry_skies:mod_ores/overworld/bauxite. It introduces two advanced concepts you can use in your sphere definitions that are explained below: Unique Block Groups and Weighted Block Groups.

{
	"generation_group": "starry_skies:overworld/ores",
	"generation_weight": 1.0,
	"min_size": 5,
	"max_size": 7,
	"type": "starry_skies:core",
	"type_data": {
		"core_block": "%starry_skies:bauxite_ore",
		"min_core_size": 3,
		"max_core_size": 5,
		"main_block": "$starry_skies:stones"
	},
	[...]
}

Instead of a single block state you will find an identifier for core_block here: %starry_skies:bauxite_ore. Same for the main_block, being set to $starry_skies:stones. Most entries in Sphere definitions that require a block state support a load of types to define their value:

Single Block State

"core_block": "tech_reborn:bauxite_ore"

Simple: Uses the block tech_reborn:bauxite_ore as the core block for this sphere.

List

"shell_block": [
  "minecraft:stone",
  "minecraft:cobblestone",
  "minecraft:stone_bricks"
]

If given a list of blocks, one of the blocks will be chosen at random for each sphere.

Weighted Map

"shell_block": {
  "minecraft:stone": 10,
  "minecraft:cobblestone": 5,
  "minecraft:stone_bricks": 1
}

Similar to a list, but having a weight attached: Stone will get chosen 10x more frequently than Stone Bricks. Cobblestone will get appear 5x as often as Stone Bricks.

Weighted Block Groups

"main_block": "$starry_skies:stones"

Entries starting with a $ are parsed as Weighted Block Groups.

Similar to Weighted Map above, but pulls it's values out of a separate data pack file. For this example, new mods can add new types of stone to the stones list and these stones automatically get applied to all spheres that reference the list starry_skies:stones.

Such a Weighted Block Group definition file has to be placed at data/<pack_name/starry_skies/weighted_block_groups/. Entries with the same name from different packs will be combined to form one final list.

{
	"minecraft:stone": 1000,
	"minecraft:granite": 100,
	"minecraft:diorite": 100,
	"minecraft:andesite": 100,
	"minecraft:cobblestone": 10,
	"minecraft:infested_stone": 10,
	"minecraft:mossy_cobblestone": 1,
	"minecraft:infested_cobblestone": 1
}

Unique Block Groups

"core_block": "%starry_skies:bauxite_ore"

Entries starting with a % are parsed as Unique Block Groups.

Such a Unique Block Group definition file has to be placed at data/<pack_name/starry_skies/unique_block_groups/ in a data pack. Entries with the same name from different packs will be combined to form one final list.

[
	"techreborn:bauxite_ore",
	"modern_industrialization:bauxite_ore"
]

It contains bauxite ores from multiple mods. Depending on what mods your pack has installed, some of those may not exist. In the case you only have Modern Industrialization installed, but not Tech Reborn, the first entry will be ignored and the latter be chosen. This makes sure you only ever get a single type of bauxite ore in your spheres.