Futurepack-API icon indicating copy to clipboard operation
Futurepack-API copied to clipboard

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

Open xiakkto opened this issue 1 year ago • 1 comments

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

xiakkto avatar Mar 01 '24 12:03 xiakkto

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<PlayerLoggedInEvent>((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.

Dinerell avatar Mar 01 '24 19:03 Dinerell