#Modify Worldgen
144 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
??neversay
Never say 'it crashed', 'it errored', or 'it didn't work' without providing the full crash report, log, and scripts!
??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.
??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!
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'
})
})
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)```
That could be the problem... I don't have any xD

where did you get it from?
don't tell me you are ripping off Create Above and Beyond
or trying to port
I've had enough of those people 
No I'm just trying to edit the worldgen. I want to remove redstone and change the level of apatite ore
What do you mean by this? Do people rip off other mods?
I'm using the kubejs wiki as reference for the code
some do
@shut tide didn't lat rip of those mod shortening from tutorials?
kinda like those bad more shorteners, everyone ripped them from create above and beyond
from the wiki, yes
As in, copy the code and claim it as original?
someone put them there and he yeeted them
some want to port to newer versions, some just take inspiration
Oh I see.
tho I'd recommend starting fresh instead of copying a script from another pack
Oh no I just use the wiki
good 
Or at least as far as I can get since it's still under construction
Could you perhaps quickly help with the redstone as well please?
🙏
If possible
I don't know much about kjs worldgen
I'd just wait for someone more expirienced with worldgen to help
I assume this ticket can stay open for now then
maybe open new ticket with exact problem description
and how are you testing if it is working or not?
I can try that.
I use command blocks to remove a large area of stone and other blocks (I checked out a video), and the ores stay behind.
every time in a new generated world?
Yeah, since it is a startup script.
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
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.
Paste version of startup.log from @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
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']) })
I thought worldgen was disabled and to be ported into it's own mod?
i think youre thinking of 1.20
maybe I misread the wiki, thought it pertained to 1.19, you are probably right
[Quote ➤](#future-vision message) #
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.
ye
Ah, thank you, I'll give this a try.
I am testing it now.
Unfortunately no luck. Redstone still appears somehow.
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"
Ooooh, well that makes a lot more sense xD
And is it the same for the deepslate version?
lemme check
can't you also print the biome specific worldgen to see the names?
a really cool mod to use btw that exports worldgen settings from all mods is called corgilib
Ah, thank you very much. Let's try this one more time
you could yes, very useful thing to do
Still no luck. For what version is this? We are using 1.19.2
??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.
??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.
send both
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')
})
Paste version of startup.log from @tired plume
you have to specify the feature type
[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']) })
going back to this
event.removeFeatureById('featuretype', 'feature:id')```
??kjswiki
You can add and remove worldgen features with KubeJS, and the wiki has pages on those!
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)
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
It works! Redstone is removed from generation. Thank you for the help.
One more thing:
how to do I get to this file path? I have corgilib installed
after you do /corgi export worldgensettings command youll find all the exported worldgen settings in your config>corgilib folder
Ah
youll also see my file path in the screenshot i sent before i believe
wait thats wrong
Also, the deepslate redstone is still generating, is that because it has its own .json file like normal redstone?
this command doesn't seem to work. Is there a different version of the command for 1.19.2?
i was paraphrasing it
the actual command should autocomplete after you do /corgilib
/corgilib worldRegistryExport
Ah found it, the files were still laoding
i will mention that ive been on 1.19 this whole time so theres really no difference in our instances
great!
Oh neat
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
Oh awesome, thanks man
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.