Started by
yesrebel
on
Topic category: Help with Minecraft modding (Java Edition)
I need to make an entity spawn at a random block within a 20-block cube around the player, only if the block is air. Since I need it to spawn while you're in the caves or just underground in general.
Check sky light level = 0 for underground, also check y level is below 64 or so.
Use on player tick update, use the procedure template check block in 6x6x6 area, change the values to be a 20x20x20 area. Then on the if block = block, change to block = air, AND sky light = 0, AND y<64, if all true spawn entity at that position. Also make a local logic variable, set it to true after spawning the entity so that oly one spawns. Also prior to the template you should add a random chance for this to occur.