Started by
Terminnus
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making a mod that adds crates to the game, a block that gives you some loot when you destroy it, I want to add a feature that generates 4 basic crates near where the player spawns (much like the bonus chest), Is there any way to do that?, thanks!
PD: sorry for my English, I'm not a native
Edited by Terminnus on Wed, 09/25/2024 - 02:32
You can make a feature. On additional generation condition get world spawn coordinates and return false if x y z of feature placement is further than 10 or so blocks in any direction. Then make a variable that is false and only allows the feature to spawn when it is false. On player joins world set the variable to true. Also set the generation to the latest it can be. Hopefully that would make it only spawn once. With this method though I guess theres a chance the crate might not spawn at all. Idk try it out and see if it works.