How do I make a naturally-generating block tick?

Started by afk on

Topic category: Help with modding (Java Edition)

Last seen on 10:13, 24. Jun 2024
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a naturally-generating block tick?

The title says it all; I want to have a light-sensitive block in my mod that checks the light levels of nearby blocks, and if they're above 10, spawns a cluster of small hostile flying mobs. 

This generates naturally through a feature that places a structure.. but it doesn't tick. It's fine if a player places it, but not if it generates naturally. I've tried everything to make it work; giving it a 'tick manually' procedure when it's added to the world, scheduling ticks, etc.. nothing has worked so far.

If anyone has any ideas, I'll gladly hear them.