概述
新的矿石生成设置在 config/orespawn/*.json 中以 JSON 格式定义(其中 * 是任何文件名)。
ore-spawn.json 文件的基本格式是这样的:
{ "dimensions":[ { "dimension":0, "ores":[ { "blockID":"minecraft:emerald_ore",
"size":1, "variation":0, "frequency":8, "minHeight":4, "maxHeight":32,
"biomes":["Extreme Hills Edge","Extreme Hills"] } ] } ] }
变量
dimensions:JSON 对象数组,每个对象描述该维度的矿石生成。
dimension:设置矿石在哪个维度生成。如果你将维度设置为 + 而不是特定数字,则矿石设置将应用于此配置文件尚未涵盖的所有维度。
ores:一组矿石生成对象。
blockID:这是方块的标识符,格式为 mod-ID:block-name 其中 mod-ID 是 mod 的 ID(minecraft 是原版 minecraft 方块的 ID),block-name 是名称一块。基本上,blockID 是您将在 /give 命令中使用的文本。
size:这是每个矿床的矿石数量。
variation:这是在生成矿床时随机改变方块数量的量。
frequency:这是每个区块产生的最大矿石数量。如果这个数字小于一,那么这是其中有生成矿床的区块的分数(例如“频率”:0.1 将导致每 10 个区块有 1 个矿床)。请注意,如果将 maxHeight 设置为大于 64 的数字,那么每个区块的实际矿床数量将小于频率值,因为一些矿床会在地面上方的空气中生成。
minHeight:这是允许矿石生成的最低 Y 坐标。
maxHeight:这是允许矿石生成的最高 Y 坐标。
biomes:(可选)允许此矿石生成
的生物群系(按名称)数组。
如果你希望矿石在所有生物群落中生成,您可以指定一个空数组 [] 或干脆不使用此变量。
以下是默认的 Minecraft 矿石生成行为,作为矿石生成 JSON:
{ "dimensions":[ { "dimension":0, "ores":[ { "blockID":"minecraft:coal_ore",
"size":25, "variation":12, "frequency":20, "minHeight":0, "maxHeight":128,
"biomes":[] }, { "blockID":"minecraft:iron_ore", "size":8, "variation":4,
"frequency":20, "minHeight":0, "maxHeight":64, "biomes":[] },
{ "blockID":"minecraft:gold_ore", "size":8, "variation":2, "frequency":2,
"minHeight":0, "maxHeight":32, "biomes":[] },
{ "blockID":"minecraft:diamond_ore", "size":6, "variation":3, "frequency":1,
"minHeight":0, "maxHeight":16, "biomes":[] },
{ "blockID":"minecraft:redstone_ore", "size":6, "variation":3, "frequency":8,
"minHeight":0, "maxHeight":16, "biomes":[] },
{ "blockID":"minecraft:lapis_ore", "size":5, "variation":2, "frequency":1,
"minHeight":0, "maxHeight":32, "biomes":[] },
{ "blockID":"minecraft:emerald_ore", "size":1, "variation":0, "frequency":8,
"minHeight":4, "maxHeight":32, "biomes":["Extreme Hills Edge","Extreme Hills"] },
{ "blockID":"minecraft:dirt", "size":112, "variation":50, "frequency":10,
"minHeight":0, "maxHeight":255, "biomes":[] },
{ "blockID":"minecraft:gravel", "size":112, "variation":50, "frequency":8,
"minHeight":0, "maxHeight":255, "biomes":[] },
{ "__comment":"granite", "blockID":"minecraft:stone", "blockMeta":1,
"size":112, "variation":50, "frequency":10, "minHeight":0, "maxHeight":255,
"biomes":[] }, { "__comment":"diorite", "blockID":"minecraft:stone",
"blockMeta":3, "size":112, "variation":50, "frequency":10, "minHeight":0,
"maxHeight":255, "biomes":[] }, { "__comment":"andesite",
"blockID":"minecraft:stone", "blockMeta":5, "size":112, "variation":50,
"frequency":10, "minHeight":0, "maxHeight":255, "biomes":[] }, ] },
{ "dimension":-1, "ores":[ { "blockID":"minecraft:quartz_ore", "size":15,
"variation":4, "frequency":7, "minHeight":0, "maxHeight":128,
"biomes":[] } ] } ] }
请注意,如果你想使用 orespawn .json 配置文件从其他模组或原版 Minecraft 中生成矿石,你需要禁用其他相关模组的矿石生成,否则矿石将生成两次(原版 Minecraft 矿石生成可以通过禁用设置配置选项 disable_standard_ore_generation=true)。