Help with loading far away random chunks using commands
You can keep track of a single entity even if they are unloaded by using execute as <target> run function <function>
.
Even if the entity goes to unloaded chunks, you can target it by using @s
while inside the function. This makes it so you can teleport it and run forceload or whatever else you need at the entity.
Here is another answer that uses that artifact.