I'm trying to make a new dimension with some new biomes in it and I want each biome to have some funky tree-like structures or random (big or small) rocks. I've made a few structure files that I want to use but I keep running into errors like: Unknown registry key: minecraft:structure or Detected setBlock in a far chunk, status: minecraft:features, currently generating: ResourceKey[minecraft:worldgen/placed_feature / eds_dim:test]
#Generating Custom Configured and Placed Features
1 messages · Page 1 of 1 (latest)
i guess its probably a good idea to include the datapack for anyone trying to see what I am attempting to fix
What Minecraft version are you in?
1.21
Interesting. Well this error:
Detected setBlock in a far chunk, status: minecraft:features, currently generating: ResourceKey[minecraft:worldgen/placed_feature / eds_dim:test]
historically is caused by including bothin_squareandcount_on_every_layerin a placed_feature, so double check if you have any of those, and if so, remove thein_squarefrom them, as it's not necessary if you're usingcount_on_every_layer. I thought in 1.21 that now caused a crash, but maybe not always.
For this error:
Unknown registry key: minecraft:structure
I'd need more details
so I did some more testing and used the same placement rules to place my custom structure and place a regular oak tree:
configured_feature/test.json: {
"type": "minecraft:random_patch",
"config": {"tries": 3,"xz_spread": 7,"y_spread": 3,"feature": "eds_dim:test"
}
}
configured_feature/big_oak.json: {
"type": "minecraft:random_patch",
"config": {"tries": 5,"xz_spread": 7,"y_spread": 3,"feature": "minecraft:fancy_oak_checked"
}
}
placed_feature/test.json: {
"feature": "eds_dim:test",
"placement": [
{
"type": "minecraft:count",
"count": 1
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
}
]
}
placed_feature/big_oak.json: {
"feature": "eds_dim:big_oak",
"placement": [
{
"type": "minecraft:count",
"count": 2
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
}
]
}
as a result I found that the big oak trees place just fine with no errors, and the test structure does not place and spits out the Detected setBlock...
the test placed_feature references the test configured_feature, which then references the test placed_feature again
It's getting caught in a loop
ah, how do i make it refer to the structure\test.nbt
The only configured_feature type that can refer to structure nbt files is the fossil feature
As a general rule, structures =/= features
so how do i convert my structure files to features?
That's not really a thing
I'm struggling to find a way to explain it that doesn't sound condescending, but features just are not structures, they don't behave like structures. You can't make a feature (except fossils) place a structure, and you can't turn a structure into a feature. You can try to make a feature that looks like the shape that you want, but you have to work within the limits and tools of features
hmmm, ok. then how do I place structures and make them spawn very close together (like trees)
The closest you can get structures to spawn is about 1 per chunk
And for that you'd just do a very low separation and spacing in the structure_set file
can i use the configured feature to place something like command blocks or structure block or something, then use my datapack to fill those in with structures?
I believe a command block placed by a feature won't run automatically, even with auto:1b. Similar story for a structure block
But you can try it if you want
i'm mostly just throwing out ideas, I'll see how far I can get with structures. is jigsaw type what I am looking for? and what do I put in the start pool? (i'm using this website to help me https://misode.github.io/worldgen/structure/)
Structure generation guide
About
Guide on making custom structures using datapacks
Yes you do want jigsaw type. This guide should walk you through everything, but I do recommend reading it fully even if you aren't using Jigsaw blocks or already have your build. It's very thorough, with information provided at the earliest time it's needed, so skipping ahead may not tell you something you ought to have known for an earlier step that you've technically already completed
how do i set structure spawning conditions, like only spawn on grassblocks above y=105
You can't do block predicate filters like that for structures. You can set a height range if you don't project to a heightmap
Which is done in the worldgen/structure file
what does the processor do in the template file? the wiki briefly mentioned them but didn't go into detail. it seems like I can set rules and stuff with them
Processors let you set rules to apply to the structure or the area contained within its bounding box during or after placement. It's how villages get a random assortment of mossy cobblestone, for example
They are pretty powerful but don't have anything to do with where the structure is allowed to attempt to spawn. They come after
can they say if a structure is going to spawn, replace every block with air?
Technically, but not based on where the structure is
Is it possible to make your own configured structure type or do you need to use the prebuilt ones? Also, with the tree type configured structure, can you make your own trunk placer?
ok, a few more questions...
can you do a block_predicate_filter on a struture or template pool?
can you stack placed_features so that it spawn 2 trees inside each other? (creating like combo trees or something)
how do I select multiple possible configured features from one placed feature? (I'm trying to do a "feature": {"type": "minecraft:simple_random_selector","config": {"features": [...]}} and its not working)
- No
- Yes, but it's tricky
- Simple random selector, or just random selector, are the way to go. The latter is used more frequently in my experience, but the former should work fine. In what way isn't it working?
for the random selector, when I put the paths to the configured features into the random selector, I get an error saying that "unbound values in registry" and then it lists everything in the random selector pool as well as the default
> Errors in registry minecraft:root:
>> Errors in element minecraft:worldgen/placed_feature:
java.lang.IllegalStateException: Unbound values in registry ResourceKey[minecraft:root / minecraft:worldgen/placed_feature]: [eds_dim:desert/glass_disks/black_1, eds_dim:desert/glass_disks/black_2, eds_dim:desert/glass_disks/glass_2]
do you want me to share the json file?
it works just fine with default minecraft references but not with my custom configured_features
ok, progress, apparently when listing things in the random_selector inside the placed_feature file, you need to list other placed_features not configured_features, so now with some weird looking 200 lines of duplicate code, it is working, but the random selector is only pulling the first element from the list of features, and after rearranging the list, it still picks the top element.
is it because i'm doubling up the placement rules?
{
"feature": {
"type": "minecraft:random_selector",
"config": {
"features": [
{
"chance":1,
"feature": {
"feature": "eds_dim:desert/glass_disks/cyan_1",
"placement": [{"type": "minecraft:in_square"},{"type": "minecraft:heightmap","heightmap": "WORLD_SURFACE_WG"},{"type": "minecraft:rarity_filter","chance": 2}]
}
},
{
"chance":1,
"feature": {
"feature": "eds_dim:desert/glass_disks/black_1",
"placement": [{"type": "minecraft:in_square"},{"type": "minecraft:heightmap","heightmap": "WORLD_SURFACE_WG"},{"type": "minecraft:rarity_filter","chance": 2}]
}
}
...
],
"default": "minecraft:crimson_fungi"
}
},
"placement": [
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:rarity_filter",
"chance": 2
}
]
}
ok, and now switching back to a simple random selector now works just fine... weird.
i guess if it works it works
You can list an in-line placed feature with no placements, that references the configured feature, in order to not have to duplicate anything
so what would that look like in the code, and would I have to create any new files?
I'm getting a new error Detected setBlock in a far chunk, status: minecraft:features, currently generating: ResourceKey[minecraft:worldgen/placed_feature / eds_dim:desert/glass_disk]and i'm wondering if the duplicate placements are causing it
Could be duplicate placements if you're still not including both a count_on_every_layer + in_square
You would not have to create any new files. Are you using Misode to help generate these?
yeah
but misnode doesnt let me link to files i've already created, so im struck trying to guess how to replace the inlines with my own stuff
its weird there error doesnt pop up all the time, and the glass_disk's still gerenrate but its filling my console and I dont think its a good thing
Well here's a random selector with in-line placed features that reference configured features
"type": "minecraft:random_selector",
"config": {
"features": [
{
"chance": 0.33,
"feature": {
"feature": "minecraft:oak",
"placement": []
}
}
],
"default": {
"feature": "minecraft:oak",
"placement": []
}
}
}
ahhhh, so leave placement blank...
ok, code works, but I still get the Detected setBlock in a far chunk error
Let's see the placed feature that's causing it
it seems to have stopped causing the error, so idk.
do you know how to change the block tags for deepslate_ore_replacable to include blackstone?
Do you know what a block tag is?
kinda, i made a file minecraft/tags/blocks/deepslate_ore_replacables.json and put {"replace": false,"values": ["minecraft:deepslate","minecraft:tuff","minecraft:blackstone"]}
but that didnt solve my problem
That is indeed how you would add blocks to a vanilla block tag
But, if you're in 1.21, it's tags/block, not tags/blocks
i dont think that worked
You're sure it's spelled replacables and not replaceables?