KubeJS (Old)

KubeJS (Old)

3M Downloads

addTarget does not support blocks generated from KubeJS

TriedAngle opened this issue ยท 1 comments

commented

Minecraft Version

1.18.1

KubeJS Version

1801.4.2-build.300

Rhino Version

1801.1.8-build.102

Architectury Version

3.7.22

Forge/Fabric Version

Forge 39.0.85

Describe your issue

addOre under worldgen.add does not support custom ores.

this works

onEvent('worldgen.add', event => {
    event.addOre(ore => {
        ore.addTarget('#minecraft:base_stone_overworld', 'minecraft:glowstone')
        ore.count(4, 10)
        ore.size(60)
        ore.uniformHeight(1, 64)
        ore.squared()
    })
})

this does not work and has the following error:
[21:42:39] [ERR ] Target block state is empty!

onEvent('block.registry', event => {
    event.create('ruby_ore', block => {
        block.material('rock')
        block.hardness(3.0)
        block.displayName('Ruby Ore')
    });
})
onEvent('worldgen.add', event => {
    event.addOre(ore => {
        ore.addTarget('#minecraft:base_stone_overworld', 'kubejs:ruby_ore')
        ore.count(4, 10)
        ore.size(60)
        ore.uniformHeight(1, 64)
        ore.squared()
    })
})

Clicking New World ingame also crashes

Crash report/logs

No response

commented

This should've been fixed in that linked commit hopefully, worldgen now happens right after registries
^^