Futurepack Mod - Now with flyable Spaceships!

Futurepack Mod - Now with flyable Spaceships!

1M Downloads

[1.18.2]Crafttweaker support Research,but Research System has not been initialisated yet!

xiakkto opened this issue ยท 1 comments

commented

When I create a Research with Crafttweaker, every time I reopen the game, this error message appears. Although this can be resolved by using the /reload command, it has caused significant trouble for my mod.

image
image

commented

You can trigger it later on PlayerLoggedIn-Event. Crafttweaker can only check if a mod is loaded via a preprocessor and preprocessors can be mandatory but it helps preventing it from executing the scripts in an unwanted manner resulting in many errors.

Something like this:

#priority 80
#modloaded futurepack

Still, to change at which time this code will be triggered, I decided it would be best to use the PlayerLoggedIN-Event from Crafttweaker.

These imports

import crafttweaker.api.events.CTEventManager;
import crafttweaker.api.event.entity.player.PlayerLoggedInEvent;

using this code copying your actual code into it

CTEventManager.register((event) => {

});

at least triggers it later although /reload won't trigger the execution anymore. You can basicly ignore the error and just /reload the game until it is final and you need to use this event for the final version.