Skip to content

BlockDefinition

Jasmine Iwanek edited this page Jul 3, 2021 · 4 revisions

To allow for multiple blocks in a single spawn, use of the OreDictionary and the sheer desire to have data properly encapsulated it was decided to have a simple json-object format defined for providing the data needed for MMD OreSpawn to be able to get a copy of the block instance and place it in the world.

A basic (but complete) sample of the format is:

{ "name": "minecraft:wool", "metaData": 0, "chance": 100 }
{ "name": "chisel:limestone2", "state": "variant=7", "chance": 100 }
{ "name": "ic2:resource", "state": "type=copper_ore", "chance": 100 }
{ "name": "nuclearcraft:ore", "state": "type=tin", "chance": 100 }
{ "name": "tconstruct:ore", "state": "type=cobalt", "chance": 100 }
{ "name": "ore:silver_ore", "chance": 100" }

In the six examples above we can see all the options demonstrated - for the first, classic white wool, for the second, one of the variants of limestone from the mod "chisel", for the third, IC2's Copper Ore, for the fourth, NuclearCraft's tin ore, the fifth Tinkers' Construct cobalt, and lastly a use of the OreDictionary. Truthfully the only part of the block definition that needs to exist is the name, though it is a good habit to include the "chance" that defines a raw probability that any given block in a block-list (which is what the "blocks" part of a spawn entry is) will be selected.

The "metaData" member will remain supported for Minecraft 1.12 and prior, but with the removal of metadata from the game entirely in 1.13 it is impossible to retain.