I am currently working on a resource pack that replaces quite a few of vanilla's structures. To do this I am using the structure void block to first load the structures I want to edit, modify them and then save them to my hard drive, from where I drag and drop them into my resource pack.
For the most part, this process works exactly as it should, parts of villages and the woodland mansion (the two structures I am currently working on) are replaced with my custom pieces.
The problem is how world gen deals with air blocks in structure files, or rather how it doesn't.
According to the wiki structure void blocks "[are] part of a structure and are ignored when the structure file is saved. This results in the blocks at the location where the structure is placed being maintained and not being overridden".
This works fine when I load the structure with a structure block, both air and normal blocks are set while void blocks are ignored, everything works as intended.
However, when a structure is generated by the world generator things are different.
Instead of behaving the way they should according to the wiki void block and normal blocks are placed while air blocks are ignored. This means that the places I want to be empty (e.g. interior rooms) can be filled with any blocks that were there before my structure was spawned while the blocks where I want to keep any previous blocks are now filled with void block.
Short version:
Current behavior when a structure is generated by world gen:
All blocks except air are set (including structure void blocks)
Expected behavior when a structure is generated by world gen:
All normal blocks are set
Structure void block are ignored
Air blocks are replaced with cave air blocks so that later parts of world gen can't generate inside my rooms
Steps to reproduce:
Modify a village structure and attempt to add a cellar using jigsaws and structure void blocks.
Comments 3
@Jaceen No, exactly the other way around. Void blocks are used to mark parts of my structure where I don't want to place any block and keep whatever block there was previously.
A good example of this would be a circular structure. Structures are always rectangular, but by filling the corners with void blocks I can tell Minecraft that this part of the structure should be ignored and only the circular part in the middle should be generated.
This works fine as long as the structure is placed by a structure block (using "load"), but whenever moment the structure is placed by Minecraft's world generator void blocks are set (even though they should be ignored) and air blocks are ignored (even though they should be set; preferable as CAVE AIR blocks so they can no longer be overriden by other parts of world gen).
If I am understanding what you are saying.
The Structure void is supposed to be used in place of air when saving structures so that when the structure loads it will always be an air block. If you save an air block in a structure that can be replaced with any block in the world generation.