#Modify Worldgen

144 messages · Page 1 of 1 (latest)

tired plume
#

Ore generation is unaffected. Thermal ores are only supposed to spawn at -32, 32 in the plains biome.
Redstone ore is still generating even though it should be removed completely. Any help and suggestions are welcome.

rare axleBOT
#

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

shut tide
#

??neversay

solar pumiceBOT
# shut tide ??neversay

Never say 'it crashed', 'it errored', or 'it didn't work' without providing the full crash report, log, and scripts!

shut tide
#

??kjslogs

solar pumiceBOT
# shut tide ??kjslogs

You can find your KubeJS server log in /minecraft/logs/kubejs/server.log.
If you are on 1.18 or below it will be called server.txt.
Please send it if asked, as it contains helpful information.

shut tide
#

??sendcode

solar pumiceBOT
# shut tide ??sendcode

Send your code here instead of a screenshot

It makes it easier to diagnose your code and help you fix it or make the required changes/additions.

#

The thing you are trying to do can probably be achieved using the mods config, without anything extra!
Most mods have at least one config located at instance/config.
Some mods also have serverconfigs, found at instance/saves/worldname/serverconfig. You can copy any files in here to the defaultconfigs folder to automatically apply them to new worlds!

shut tide
#

and that

tired plume
# shut tide ??sendcode
WorldgenEvents.remove(event => {
    event.removeOres(props => {
        props.worldgenLayer = "underground_ores"
        props.blocks = [MC('redstone_ore'), MC('deepslate_redstone_ore')]
    })
})
WorldgenEvents.add( event => {
    event.addOre(ore => {
        ore.id = KJ('apatite_redo')
        ore.biomes = {
            id: MC('plains')
        }
        ore.addTarget(MC('#stone_ore_replaceables'), TE('apatite_ore'))
        ore.addTarget(MC('#deepslate_ore_replaceables'), TE('deepslate_apatite_ore'))

        ore.count([1,3])
        .squared()
        .triangleHeight(anchors.aboveBottom(32), anchors.absolute(32))

        ore.size = 6
        ore.noSurface = 0.6
        ore.worldgenLayer = 'underground_ores'
    })
})
wet bloom
#

how are anchors defined?

#

don't see in code

tired plume
#

Sorry, here you go.

let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let CR = (id, x) => MOD("create", id, x)
let KJ = (id, x) => MOD("kubejs", id, x)
let MC = (id, x) => MOD("minecraft", id, x)
let TE = (id, x) => MOD("thermal", id, x)```
wet bloom
#

still don't see anchors

#

is anchors a global kubejs stuff?

tired plume
wet bloom
#

where did you get it from?

#

don't tell me you are ripping off Create Above and Beyond

#

or trying to port

shut tide
tired plume
#

No I'm just trying to edit the worldgen. I want to remove redstone and change the level of apatite ore

tired plume
tired plume
wet bloom
#

post link

#

maybe anchors was a old stuff

tired plume
wet bloom
#

@shut tide didn't lat rip of those mod shortening from tutorials?

shut tide
#

kinda like those bad more shorteners, everyone ripped them from create above and beyond

tired plume
shut tide
#

someone put them there and he yeeted them

shut tide
shut tide
#

tho I'd recommend starting fresh instead of copying a script from another pack

tired plume
#

Oh no I just use the wiki

shut tide
#

good heh

tired plume
#

Or at least as far as I can get since it's still under construction

wet bloom
#

const { anchors } = event

#

you missed

#

this

tired plume
#

Yeah I just saw that on the wiki xD

#

Thank you kindly

wet bloom
shut tide
tired plume
#

Could you perhaps quickly help with the redstone as well please?

wet bloom
#

🙏

wet bloom
#

I don't know much about kjs worldgen

tired plume
#

Is there someone else I could ask?

#

Or do you guys want to give it a try? xD

shut tide
#

I'd just wait for someone more expirienced with worldgen to help

tired plume
wet bloom
#

maybe open new ticket with exact problem description

and how are you testing if it is working or not?

tired plume
wet bloom
#

every time in a new generated world?

tired plume
#

Yeah, since it is a startup script.

wet bloom
#

and fixing anchors fixed what?

#

why you still have problem?

tired plume
#

I'm still testing it, one moment please

#

It didn't seem to work after addingjs const { anchors } = event

#

Not sure what I am missing

solar pumiceBOT
#

You can find your KubeJS startup log in /minecraft/logs/kubejs/startup.log.
If you are on 1.18 or below it will be called startup.txt.
Please send it if asked, as it contains helpful information.

tired plume
solar pumiceBOT
#

Paste version of startup.log from @tired plume

wet bloom
#

don't see anything wrong

#

can you tell what doesn't work?

tired plume
#

Redstone ore should not be spawning at all (but it still does). And apatite must spawn from level 32 and below, but still appears around level 55.

Apologies for the late response

vapid folio
#

i havent read the full ticket so idk if this has been solved yet but to remove an ore completely i do this in my pack js WorldgenEvents.remove(event => { // remove features by their id (first argument is a generation step) event.removeFeatureById('underground_ores', ['gothic:magic_ore_stone', 'minecraft:magic_ore_deepslate']) })

floral scroll
#

I thought worldgen was disabled and to be ported into it's own mod?

vapid folio
floral scroll
solar pumiceBOT
#
lat

[Quote ➤](#future-vision message) # kubejs KubeJS for 1.20.1 has been released!

Be prepared for plenty of bugs :P (and please report them)

  • Available on both CurseForge and Modrinth as alpha versions.
  • WorldgenEvents.add() has been disabled for now for quicker release, it will be re-implemented later.
  • Worldgen events in general are likely going to move to its own first party addon because of how often it holds up development and how different it is on Forge and Fabric. Minecraft loves to rewrite worldgen nearly every version.
  • When 1.20.2 drops, .1 will likely be dropped after short period of time. It's one of those versions mostly intended for testing bugs.
vapid folio
#

ye

tired plume
tired plume
vapid folio
#

you put in the wrong ore id then

#

it isn't just called "minecraft:redstone_ore" i dont think

#

you have to use the actual feature name

#

in redstone ore's case its "minecraft:ore_redstone"

tired plume
#

Ooooh, well that makes a lot more sense xD

#

And is it the same for the deepslate version?

vapid folio
#

lemme check

floral scroll
#

can't you also print the biome specific worldgen to see the names?

vapid folio
#

a really cool mod to use btw that exports worldgen settings from all mods is called corgilib

tired plume
#

Ah, thank you very much. Let's try this one more time

vapid folio
#

looks like its all included in the ore_redstone feature

#

np

vapid folio
tired plume
vapid folio
#

??code

solar pumiceBOT
# vapid folio ??code

🗒️**Send the code!**🗒️
You may have an issue with a KubeJS script and you explain it to the best of your ability yet without the actual code in question we have very little to go off of in trying to assist you.

vapid folio
#

??kjslogs

solar pumiceBOT
# vapid folio ??kjslogs

You can find your KubeJS startup log in /minecraft/logs/kubejs/startup.log.
If you are on 1.18 or below it will be called startup.txt.
Please send it if asked, as it contains helpful information.

vapid folio
#

send both

tired plume
# vapid folio ??code
let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let CR = (id, x) => MOD("create", id, x)
let KJ = (id, x) => MOD("kubejs", id, x)
let MC = (id, x) => MOD("minecraft", id, x)
let TE = (id, x) => MOD("thermal", id, x)

WorldgenEvents.remove(event => {
    
    event.removeFeatureById('minecraft:ore_redstone')
})
solar pumiceBOT
#

Paste version of startup.log from @tired plume

vapid folio
#

you have to specify the feature type

solar pumiceBOT
#

[Quote ➤](#1178776812789182524 message) i havent read the full ticket so idk if this has been solved yet but to remove an ore completely i do this in my pack js WorldgenEvents.remove(event => { // remove features by their id (first argument is a generation step) event.removeFeatureById('underground_ores', ['gothic:magic_ore_stone', 'minecraft:magic_ore_deepslate']) })

vapid folio
#

going back to this

#
event.removeFeatureById('featuretype', 'feature:id')```
#

??kjswiki

solar pumiceBOT
vapid folio
#

all the feature types are at the bottom of the wiki page

#

in your case youre using the 'underground_ores' feature type

#

what you sent me is js event.removeFeatureById('feature:id') (no feature type specified in the feature type field which is required)

tired plume
#

Ah, I see

#

Testing it now

vapid folio
#

also if you wanted to specify multiple features at once like i did you can add them to an array like so with the brackets js event.removeFeatureById('featuretype', [ 'feature:id1', 'feature:id2' ])

#

as long as they're the same generation step

tired plume
#

It works! Redstone is removed from generation. Thank you for the help.

One more thing:

tired plume
# vapid folio

how to do I get to this file path? I have corgilib installed

vapid folio
#

after you do /corgi export worldgensettings command youll find all the exported worldgen settings in your config>corgilib folder

tired plume
#

Ah

vapid folio
#

youll also see my file path in the screenshot i sent before i believe

#

wait thats wrong

tired plume
#

Also, the deepslate redstone is still generating, is that because it has its own .json file like normal redstone?

vapid folio
#

i guess this is the parent to the ore_redstone feature

tired plume
vapid folio
#

i was paraphrasing it

#

the actual command should autocomplete after you do /corgilib

#

/corgilib worldRegistryExport

tired plume
#

Ah found it, the files were still laoding

vapid folio
#

i will mention that ive been on 1.19 this whole time so theres really no difference in our instances

#

great!

vapid folio
#

a good place to look to find what features are generating in your world is the biomes

#

lists all the features pretty much for you

tired plume
#

Oh awesome, thanks man

vapid folio
#

yup

#

??closeticket

solar pumiceBOT
# vapid folio ??closeticket

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.

Do you have any other questions regarding your issue? Feel free to ask!
Note: You generally should create a new post for unrelated issues.