I am not asking how Minecraft loads chunks or generates chunks, I am asking about individual blocks and entities and their behaviours.
Suppose you have a dirt block: dirt block can be converted to a grass block if there is a grass nearby. The game can have thousands of dirt blocks loaded at the same time, each checking if there is grass nearby.
Now add some monster spawners which have to spawn monsters periodically and keep track of how many monsters it spawned.
Then there is your large field of wheat, potatoes, carrots and saplings which the game also has to check and update every so often.
Then you have your furnaces that smelt your ores.
Then add into the mix all of the animals, monsters, villagers and their behaviours and pathfinding.
All of these actions are happening simultaneously and the game somehow keeps running smoothly on a decent computer.
How do the games generally handle this many block updates and entity behaviours? Does the game keep a list/collection of all the "updateable" blocks and just iterates every so often through that list and simply calls the ".update()" method? How are games with many updateable blocks/entities structured? Updating in a separate thread?
There are so many questions... Any clue is appreciated. Thank you.