Started by
Ahmet Enes TAŞÇI
on
Topic category: Help with Minecraft modding (Java Edition)
Hello, I have been having this problem since the day I used mcreator. I am adding a structure in mcreator that I saved with a structure block in Minecraft, but it does not appear in the "/locate" command in Minecraft. Besides all this, how can I create something that has various variations and contains more than one structure, just like villages?
There isn't an easy way to locate structures using commands, though if you really need to for some reason, (such as an achievement, or detecting proximity, or something), you could try making an invisible unkillable entity with no hitbox that's always spawned when the structure generates, and runs your desired code.
Making structures with variation is a bit easier. The correct way to do so is to figure out how to use Jigsaw blocks, which are how vanilla minecraft generates variated structures. The more entertaining way is to add your own modded blocks that randomly place/alter structures- and then instead of having a single structure, have your structure consist of a single block that randomly decides what to build where.
The second option is a lot more versatile, but does run into some issues. Terrain features like trees, for example, are normally generated after structures so as to avoid messing with them. You'll also need to force your custom structure blocks to tick by calling a procedure that updates them when the structure is loaded, since blocks placed by structures usually don't tick naturally on their own.