Started by
modbroz
on
Topic category: Help with Minecraft modding (Java Edition)
How do I have my entity spawn inside trees?
Edited by modbroz on Fri, 07/11/2025 - 15:08
Topic category: Help with Minecraft modding (Java Edition)
How do I have my entity spawn inside trees?
If the tree is a feature that places an nbt structure, you can save the nbt structure of the tree with the entity inside of it an include entities set to true. Otherwise you would need to make a custom spawning condition that checks for the log of your tree. To avoid players building trees you could have a blockstate for the log that defaults to true, but is set to false if the block is placed by a player, and the entity can only spawn if the blockstate is true. However, the first option is probably the easier one.