#KubeJS Plugin causing issues with others

22 messages · Page 1 of 1 (latest)

real swallow
#

Hello, I'm writing a mod that's an addon to Modern Industrialization. I've created a KubeJS plugin in this mod that would allow pack authors to customize the volume and duration of sounds added. In a dev environment, the plugin loads just fine, however when I try to load it in an existing pack to test, it crashes on startup and claims a method is not defined.

I'm really confused by this and don't even know where to look to fix it. The code for my mod can be found here: https://github.com/TheStaticVoid/MI-Sound-Addon

There error I'm getting in startup is included in this post. No, it's not an issue with the script itself, as it loads just fine without my mod loaded.

TLDR: I want to know what I'm doing wrong with the creation of this KubeJS Plugin.

tall plazaBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

junior rivet
#

look at the third parameter

#

in the method its looking for

#

also dont fire an event then

#

events are loaded before scripts are loaded

#

so there wont be any listeners

#

also.. why are you initializing your mod earlier if kubejs is loaded?

real swallow
#

that part i was just mimicing what MI did

#

iirc tech said it was to handle if kjs wasn't installed

#

The third parameter that is undefined in that method call is the recipe type that is added in another MI event

junior rivet
#

well it doesnt exist

#

so either you are messing something up by doing something too early, or your script has an issue

real swallow
#

it's definitely the former, as the script works without the mod loaded just fine.

real swallow
#

hey thanks for your help arug i think i got it working

junior rivet
#

what was it?

real swallow
#

made the event fire during the mod initialization and took out thing MI had for loading after kubejs finished

#

I'll have to tinker with it a bit more because I do want it to be an optional mod requirement and not break if kubejs isn't present, but it at least doesnt cause this startup crash anymore

real swallow
#

I take that back it's still broken. I think I tested it without KubeJS and it didn't break and thought it to be fixed lol. I think I don't understand is when the event should be fired. I've tried it on mod initialization, and during the sound event registration and they both break MI's compat. I'm not doing any of the shenanigans to load sooner, but should I do something to make sure my mod is loaded after MI itself or something?

real swallow
#

... and now it's working again I'm so confused

real swallow
#

Ok it's working so i'll close this lmao