Topic category: Help with modding (Java Edition)
I'm making a mod that generated structures that will be regenerated each X minutes, using a block as an anchor for the regeneration.
The regeneration procedure and it's cooldown is located inside the OnTickUpdate of the anchor block.
The thing is I cannot ensure the tick update of the block if there are no players nearby unless I forceload the chunk.
When I try to execute "forceload add ~ ~" in the structure generation procedure I get the following crash when structure is going to be generated:
java.lang.ClassCastException: net.minecraft.world.gen.WorldGenRegion cannot be cast to net.minecraft.world.server.ServerWorld
Am I doing something wrong?
Is there any other known way to achieve the chunk loading in Mcreator?
Thanks in advance