Started by
Hejejej
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making a mod that adds seasons, and i want to replace all leaves and grass with their autumn versions when it's autumn. I don't know how to check every grass and leaves block in the world.
...There really isn't any good way to do this without immediately crashing the game, at least not that I can think of off the top of my head.
...Of course, if you did this more gradually, it might just work, and suite the purposes of seasons. The problem is having that many blocks replaced at once, particulaly if they need to be ticking to keep track of time; so instead, you could make modded grass/leaf blocks that gradually spread the blocks of their respective season when randomly ticked, until there aren't any more places to spread to. ...Of course, you'd have to make a lot of custom blocks, and there would probably be conflicts with biome colormaps and whatnot, but it's the best way that comes to mind. I did something similar to make foliage grow back gradually: instead of ticking every single grass block, I just made a custom grass block that regrows foliage when there isn't any nearby, and then spreads somewhere else. You could do this with a similar system.