KubeJS (Old)

KubeJS (Old)

3M Downloads

ore.chance not working in worldgen event

Nevrai opened this issue · 0 comments

commented

Describe your issue

My custom ores are generating too commonly even the ore count is set to 1, so I wanted to try using ore.chance instead. Unfortunately, they don’t seem to generate at all if ore.chance is used. When I tested it with ore.chance set to various different values, the ore never generated. Even when it’s set to ore.chance = 1, which should mean a 1 in 1 chance (so 100%) to generate in each chunk, the ore does not generate.

On a similar note, although this isn’t the main issue I’m reporting here, ores also don’t generate at all when ore.size, which affects the vein size, is set to 1 or 2. It only seems to work when it’s set to 3 or higher.

onEvent('worldgen.add', event => {
  const {anchors} = event

  event.addOre((ore) => {
    ore.id = "kubejs:deepslate_arcane_ore_generation"
    ore.biomes = {not: "minecraft:ocean"}

    ore.addTarget('#forge:ore_bearing_ground/deepslate', 'kubejs:deepslate_arcane_ore')

    //ore.count([1])
        .squared()
        .triangleHeight(
            anchors.aboveBottom(0),
            anchors.absolute(-53)
        )                
      
        ore.size = 3
        ore.noSurface = 0.5
        ore.worldgenLayer = "underground_ores"
        ore.chance = 1              // if != 0 and count is unset, the ore has a 1/n chance to generate per chunk
    })
})

Versions

  • Minecraft: 1.18.2
  • Forge: 40.1.80
  • KubeJS: 1802.5.5-build.546
  • Rhino: 1802.2.0-build232
  • Architectury: 4.9.84