Started by
Mopru
on
Topic category: Help with Minecraft modding (Java Edition)
I'm currently trying to make a block glow, but it doesn't work like it should when it naturally generates. what I've found is that if I schedule a tick update, then it could fix the issue. here comes my problem. I don't know how to make it that specifically the block ticks ONLY when it generates, then never again so I can force it to glow like it should. how do I go about this?
By default, naturally generated blocks do not tick regularly. (In the interest of avoiding lag.) If you just want the block to glow constantly, this shouldn't be an issue, but I assume you're trying to make it pulse or something that requires a regular tick.
One workaround you might consider is making the world feature that generates this block also update them- if you're using some sort of recursive spread procedure, for example, just add a bit that updates each block on generation. (This can be kind of finnicky to get working though.) Another (arguably worse) solution could be to just get the position the player is currently looking at, and update any of your custom blocks within a 10*10 radius or something, so they trigger once observed.
good idea! didn't know you could do that. (the glow naturally doesnt work because its an ore that spawns in a different dimension)
Might still be a bit of a headache though- speaking from experience, tick update stuff can be really annoying to work with. If it's still causing trouble, it might be worth just using an animated texture and enabling emissives. (Or using optifine to give the appearance of a pulsing glow.)