#Ore doesn't spawn

23 messages · Page 1 of 1 (latest)

orchid tapir
#

Tungsten spawns. However platinum doesn't.

global.metals = [
    ['electrum', '#F2E279', 0xF2E279],
    [
        'tungsten', 
        '#333333', 
        0x333333, 
        true,
        '#minecraft:is_end',
        'minecraft:end_stone',
        [1, 4],
        0,
        250,
        4
    ],
    ['tungstensteel', '#5e5e5e', 0x5e5e5e],
    ['iridium_tungsten_alloy', '#bdbdbd', 0xbdbdbd],
    ['enderium', '#289799', 0x289799],
    [
        'platinum', 
        '#abe6ff', 
        0xabe6ff, 
        true,
        '#minecraft:is_overworld',
        '#minecraft:stone_ore_replaceables',
        'minecraft:deepslate',
        [1, 2],
        60,
        8,
        1
    ]
];
swift trellisBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

orchid tapir
#
WorldgenEvents.add(e => {
    global.metals.forEach(i => {
        if (i[3] == true) {
            if (i[0] == 'tungsten') {
                e.addOre(ore => {
                    ore.id = `ultimatech:${i[0]}_ore`
                    ore.biomes = i[4]
                    ore.addTarget(i[5], `kubejs:${i[0]}_ore`)
                    ore.count(i[6])
                        .squared()
                        .triangleHeight(
                            e.anchors.aboveBottom(i[7]),  
                            e.anchors.absolute(i[8])
                        )
                    ore.size = i[9]
                    ore.noSurface = 1
                    ore.worldgenLayer = 'underground_ores'
                    ore.chance = 0
                });
            } else {
                e.addOre(ore => {
                    ore.id = `ultimatech:${i[0]}_ore`
                    ore.biomes = i[4]
                    ore.addTarget(i[5], `kubejs:${i[0]}_ore`)
                    ore.addTarget(i[6], `kubejs:${i[0]}_deepslate_ore`)
                    ore.count(i[7])
                        .squared()
                        .triangleHeight(
                            e.anchors.aboveBottom(i[8]),  
                            e.anchors.absolute(i[9])
                        )
                    ore.size = i[10]
                    ore.noSurface = 1
                    ore.worldgenLayer = 'underground_ores'
                    ore.chance = 0
                })
            };
        };
    });
});
orchid tapir
lucid gyroBOT
#

Paste version of startup.log from @orchid tapir

reef zinc
#

The Problem ist that you aren't using an array for the replaceables in platnium

orchid tapir
#

i think i am using

#

or you mean it's not even possible

reef zinc
#
global.metals = [
    [
        'platinum', 
        '#abe6ff', 
        0xabe6ff, 
        true,
        '#minecraft:is_overworld',
        [
          '#minecraft:stone_ore_replaceables',
          'minecraft:deepslate'
        ],
        [1, 2],
        60,
        8,
        1
    ]
];

You would need to use this instead

#

For the platnium

orchid tapir
#

why

#

i need stone to be replaced with platinum

#

and deepslate with deepslate platinum

#

not stone and deepslate with platinum ore

reef zinc
#

Oh nevermind, you have written a different Code for both

#

Didn't See that

prime isle
# orchid tapir Tungsten spawns. However platinum doesn't. ```js global.metals = [ ['electru...

Why are you storing an array of arrays of different data??

global.metals = [
    {
        name: 'electrum',
        colorHex: '#F2E279',
        colorDecimal: 0xF2E279
    },
    {
        name: 'tungsten',
        colorHex: '#333333',
        colorDecimal: 0x333333,
        special: true,
        dimensionRequirement: '#minecraft:is_end',
        replaceableBlocks: 'minecraft:end_stone',
        spawnTries: [1, 4],
        minHeight: 0,
        maxHeight: 250,
        veinSize: 4
    },
    {
        name: 'tungstensteel',
        colorHex: '#5e5e5e',
        colorDecimal: 0x5e5e5e
    },
    {
        name: 'iridium_tungsten_alloy',
        colorHex: '#bdbdbd',
        colorDecimal: 0xbdbdbd
    },
    {
        name: 'enderium',
        colorHex: '#289799',
        colorDecimal: 0x289799
    },
    {
        name: 'platinum',
        colorHex: '#abe6ff',
        colorDecimal: 0xabe6ff,
        special: true,
        dimensionRequirement: '#minecraft:is_overworld',
        replaceableBlocks: '#minecraft:stone_ore_replaceables',
        spawnBaseBlock: 'minecraft:deepslate',
        spawnTries: [1, 2],
        minHeight: 60,
        maxHeight: 8,
        veinSize: 1
    }
];

then access each metal using

global.metals.forEach(metal => {
    let {name, colorHex, colorDecimal, special, dimensionRequirement, replaceableBlocks, spawnBaseBlock, spawnTries} = metal
})
#

As for why ore doesnt spawn I cant really help you i was really bad with this part of kjs pepelaugh

prime isle
#

The code I sent was an array of objects, each object you can get data out as such

global.metals.forEach(metal => {
    metal.name
    metal.spawnTries
})
#

Its much easier to work with than trying to iterate using numbers

#

{} define an object, [] define an array

#

You dont have to use it the way I sent if you are fine doing it your way but it is much easier to work with