#Generating Custom Configured and Placed Features

1 messages · Page 1 of 1 (latest)

trim quarry
#

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]

#

i guess its probably a good idea to include the datapack for anyone trying to see what I am attempting to fix

fading crater
#

What Minecraft version are you in?

trim quarry
#

1.21

fading crater
#

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 both in_square and count_on_every_layer in a placed_feature, so double check if you have any of those, and if so, remove the in_square from them, as it's not necessary if you're using count_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

trim quarry
#

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...

fading crater
#

the test placed_feature references the test configured_feature, which then references the test placed_feature again

#

It's getting caught in a loop

trim quarry
#

ah, how do i make it refer to the structure\test.nbt

fading crater
#

The only configured_feature type that can refer to structure nbt files is the fossil feature

#

As a general rule, structures =/= features

trim quarry
#

so how do i convert my structure files to features?

fading crater
#

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

trim quarry
#

hmmm, ok. then how do I place structures and make them spawn very close together (like trees)

fading crater
#

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

trim quarry
#

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?

fading crater
#

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

trim quarry
#

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/)

lethal heraldBOT
fading crater
#

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

trim quarry
#

how do i set structure spawning conditions, like only spawn on grassblocks above y=105

fading crater
#

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

trim quarry
#

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

fading crater
#

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

trim quarry
#

can they say if a structure is going to spawn, replace every block with air?

fading crater
#

Technically, but not based on where the structure is

trim quarry
fading crater
#

Do you mean configured_feature?

#

Assuming yes, the answer to both questions is no

trim quarry
#

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)

fading crater
#
  1. No
  2. Yes, but it's tricky
  3. 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?
trim quarry
#

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

fading crater
trim quarry
#

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

fading crater
fading crater
trim quarry
#

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

fading crater
#

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": []
    }
  }
}
trim quarry
#

ahhhh, so leave placement blank...
ok, code works, but I still get the Detected setBlock in a far chunk error

fading crater
#

Let's see the placed feature that's causing it

trim quarry
#

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?

fading crater
#

Do you know what a block tag is?

trim quarry
#

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

fading crater
#

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

trim quarry
#

i dont think that worked

fading crater
#

You're sure it's spelled replacables and not replaceables?

trim quarry
#

............no

#

thank you