Started by
The Very Expir…
on
Topic category: Help with Minecraft modding (Java Edition)
I've recently been experimenting with structures, and everything has been working fine. The only problem is that the structure just floats in mid-air when it's supposed to be on the ground. Is there any way to either generate flat land around it, or make it only spawn on flat land?
Yes, but you'll wind up getting down a (in my experience) pretty significant rabbit hole that is advanced custom structures...
In previous versions of MCreator this was a bit easier, since you could make world features that ran procedures when placed. You can still do this in later versions, but you either need to manually alter the code, or run it through something like an entity.
The basic idea is that, instead of loading a structure, you make a feature that runs a procedure post-generation. (So after the terrain has already all generated.) You can make a custom condition, (say, running a recursive procedure that checks if the surrounding area is sufficently flat- or just checking if the corners are more-or-less flat), and then run additional custom code. (Such as randomly selecting from multiple different structures, or combining different components to make a big procedural structure.) This is the general principle behind my projects, but it's gotten increasingly complicated, especially with the recent updates.
...But if you want an easier solution, I believe there's just an 'add terrain' option, like that used in villages, for regular structures. Might not look as nice though. =)
I'm on an older version (2022.3), is this the feature you mentioned? https://imgur.com/a/6Wpglk5
If not, I'm not really sure how to use custom code as I only have experience in JavaScript, and I really don't want to learn Java just for a Minecraft mod.
Also I don't see an 'add terrain' option, maybe it's a newer feature?
Thank you for helping btw :)
Yep, those are all newer features. The bad news is that until 2023.4, structures are treated as world features, so you can't use some of the options for vanilla structures. (Like ground generation.) However, the good news is that in the earlier versions, you can make procedures that run when your structure is generated without having to manually override the code. You should be able to just make a structure, and add a procedure that runs when the structure is generated. (Either to check for solid ground before placing it, or to add solid ground below it.
Thanks! This helps a lot