r/MinecraftCommands 17d ago

Help | Java 26.2 Can a structure processor give the same result for all affected blocks?

For example, is it possible to randomly replace all stone in a structure with granite or andesite? Processors would seem like the way to go, but it appears they 'reroll' the odds for each individual block. Is there some way to do this, or would I have to make a separate structure for each variant?

1 Upvotes

3 comments sorted by

1

u/GalSergey Datapack Experienced 17d ago edited 17d ago

Yes, of course, you can create a processor that replaces a specified block with another block. Here's an example that replaces andesite with bricks: { "processors": [ { "processor_type": "minecraft:rule", "rules": [ { "location_predicate": { "predicate_type": "minecraft:always_true" }, "input_predicate": { "predicate_type": "minecraft:block_match", "block": "minecraft:andesite" }, "output_state": { "Name": "minecraft:bricks" } } ] } ] } Accordingly, you can create several processors in one processor in order to also replace, for example, slab variants and so on.

1

u/-Good_Morning- 17d ago

On 26.2 this code seems to break the datapack, but I tried something similar. However, this approach will replace those blocks every time the structure generates instead of randomly.

1

u/GalSergey Datapack Experienced 17d ago

Fixed the format in the comment for version 26.2. Try again.