#start up scripts basic js functions not recognized

62 messages · Page 1 of 1 (latest)

unkempt drift
#

for some reason it seams like some core js functions arent loaded until the start up script for some reason,
is this intended or am i doing something wrong?
Log:
[09:49:18] [ERROR] ! generate.js#45: Error in 'StartupEvents.registry': TypeError: Cannot find function concacat in object literal{Iron fishing scroll}[style={color=#A5DEFF}].
(the rest is just info stuff)

reef parcelBOT
#

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

unkempt drift
#

...

#

xdddddddddd

#

and what about concacats! dont you like them?

#

xdddd

smoky gate
#

Close the ticket fella

#

xd

unkempt drift
#

hold on i have more xd

#

log:

[09:59:35] [ERROR] ! Error in 'StartupEvents.registry': argument type mismatch
[09:59:35] [ERROR] ! java.lang.IllegalArgumentException: argument type mismatch
[09:59:35] [ERROR] !   at java.lang.reflect.Method.invoke(Method.java:569)
[09:59:35] [ERROR] !   at …rhino.MemberBox.invoke(MemberBox.java:160)
[09:59:35] [ERROR] !   at …rhino.NativeJavaMethod.call(NativeJavaMethod.java:463)
[09:59:35] [ERROR] !   at …rhino.Interpreter.interpretLoop(Interpreter.java:986)
[09:59:35] [ERROR] !   at …rhino.Interpreter.interpret(Interpreter.java:370)
[09:59:35] [ERROR] !   at …rhino.InterpretedFunction.call(InterpretedFunction.java:72)
[09:59:35] [ERROR] !   at …rhino.Context.callSync(Context.java:1357)
[09:59:35] [ERROR] !   at …rhino.ArrowFunction.call(ArrowFunction.java:42)
[09:59:35] [ERROR] !   at …rhino.NativeArray.iterativeMethod(NativeArray.java:1314)
[09:59:35] [ERROR] !   at …rhino.NativeArray.execIdCall(NativeArray.java:1798)
[09:59:35] [ERROR] !   at …rhino.IdFunctionObject.call(IdFunctionObject.java:103)
[09:59:35] [ERROR] !   at …rhino.Interpreter.interpretLoop(Interpreter.java:986)
[09:59:35] [ERROR] !   at …rhino.Interpreter.interpret(Interpreter.java:370)
[09:59:35] [ERROR] !   at …rhino.InterpretedFunction.call(InterpretedFunction.java:72)
[09:59:35] [ERROR] !   at …rhino.Context.callSync(Context.java:1357)
#
[09:59:35] [ERROR] !   at …rhino.Context.doTopCall(Context.java:1374)
[09:59:35] [ERROR] !   at …rhino.InterpretedFunction.call(InterpretedFunction.java:70)
[09:59:35] [ERROR] !   at …rhino.Context.callSync(Context.java:1357)
[09:59:35] [ERROR] !   at …rhino.ArrowFunction.call(ArrowFunction.java:42)
[09:59:35] [ERROR] !   at …rhino.Context.callSync(Context.java:1357)
[09:59:35] [ERROR] !   at …rhino.InterfaceAdapter.invoke(InterfaceAdapter.java:125)
[09:59:35] [ERROR] !   at …rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:74)
[09:59:35] [ERROR] !   at TRANSFORMER/jdk.proxy3/jdk.proxy3.$Proxy158.onEvent(Unknown Source)
[09:59:35] [ERROR] !   at …kubejs.event.EventHandlerContainer.handle(EventHandlerContainer.java:39)
[09:59:35] [ERROR] !   at …kubejs.event.EventHandler.postToHandlers(EventHandler.java:304)
[09:59:35] [ERROR] !   at …kubejs.event.EventHandler.post(EventHandler.java:264)
[09:59:35] [ERROR] !   at …kubejs.event.EventHandler.post(EventHandler.java:226)
[09:59:35] [ERROR] !   at …kubejs.event.EventHandler.post(EventHandler.java:205)
[09:59:35] [ERROR] !   at …kubejs.registry.RegistryInfo.fireRegistryEvent(RegistryInfo.java:426)
[09:59:35] [ERROR] !   at …kubejs.KubeJS.<init>(KubeJS.java:154)
[09:59:35] [ERROR] !   at …kubejs.forge.KubeJSForge.<init>(KubeJSForge.java:51)
[09:59:35] [ERROR] !   at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
[09:59:35] [ERROR] !   at java.lang.reflect.Constructor.newInstance(Constructor.java:481)
[09:59:35] [ERROR] !   at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:77)
[09:59:35] [ERROR] !   at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$5(ModContainer.java:126)
[09:59:35] [ERROR] !   at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
[09:59:35] [ERROR] !   at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
north cargoBOT
#

Paste version of startup.log from @unkempt drift

unkempt drift
#

:p

#
StartupEvents.registry("item", event => {
    const job_scrolls = [
        // fishing
        ["iron_fishing_scroll", "common",   [Text.of('Iron fishing scroll').color(0xA5DEFF)]],
        ["gold_fishing_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_fishing_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

        ["iron_hunting_scroll", "common",   Text.of('funi block').color(0xA5DEFF)],
        ["gold_hunting_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_hunting_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

        ["iron_mining_scroll", "common",   Text.of('funi block').color(0xA5DEFF)],
        ["gold_mining_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_mining_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

        ["iron_foresting_scroll", "common",   Text.of('funi block').color(0xA5DEFF)],
        ["gold_foresting_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_foresting_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

        ["iron_farming_scroll", "common",   Text.of('funi block').color(0xA5DEFF)],
        ["gold_farming_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_farming_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

        ["iron_magic_scroll", "common",   Text.of('funi block').color(0xA5DEFF)],
        ["gold_magic_scroll", "uncommon", Text.of('funi block').color(0xA5DEFF)],
        ["diamond_magic_scroll", "rare",  Text.of('funi block').color(0xA5DEFF)], 

    ]
#
    job_scrolls.forEach(scroll => {
        const first_word = scroll[0].split("_")[0];
        const warning_tooltip = [
            Text.of('Warning:').color(0xF75D8B).bold(),
            Text.of('Dont trade or ever'       ).color(0xFF9AB8),
            Text.of('loose this item'          ).color(0xFF9AB8),
            Text.of('use it now or trade it in').color(0xFF9AB8),
            Text.of('for a different job'      ).color(0xFF9AB8),
        ]
        // add the warning to each tooltip
        scroll[2] = scroll[2].concat(warning_tooltip)

        event.create(scroll[0])
        .unstackable()
        .rarity(scroll[1])
        .tooltip(scroll[2])
        .textureJson({
            layer1: 'kubejs:item/fishing_scroll_' + first_word,
            layer0: 'kubejs:item/fishing_scroll'})
        .modelJson({parent: 'kubejs:item/scroll'})
    });
});
#

here is my code

#

nvm

#

im dumb

#

xd

light junco
#

Funi block lol

smoky gate
#

lul

unkempt drift
#

pls tell me i spelled concat correct this time xd

north cargoBOT
#

Paste version of startup.log from @unkempt drift

unkempt drift
#

im having trouble again :D yey

unkempt drift
#

im having the same issue as before @smoky gate

#

even when spelled correctly or at least i think it is

#

and mozilla says yes you can do concat with arrays

unkempt drift
smoky gate
# unkempt drift ye

i have not looked at your code but there's a chance Rhino doesn't like concat?

#

random ass guess, maybe try using concat in a simple logging instruction and see if that cries

light junco
#

Just copy paste the example into kjs and see if it errors

light junco
light junco
#

And wha happen hmmm

unkempt drift
#

xd big modpack give it a second

unkempt drift
unkempt drift
#

i woke up at 4 am today ^^

#

so ah xd i may make some stupid mistakes

light junco
unkempt drift
#

ah ye true i could just comment out the start up script

light junco
unkempt drift
#

xd different part crashed hold on a second

#

i need to get some duct tape to hold this thing together

#

duck*

light junco
#

This is why I always had separate kjs-only instances :P

unkempt drift
#

xd thatssssssssssss

#

a actually really good idea

#

ah but then some scripts require mods for recipe and tags and stuff

#

but ye i could make like a min modpack version with only the mods that my kube js scripts use

light junco
#

I used to keep it minimal and use placeholder vanilla items for recipes, then replace them when put back into the pack

unkempt drift
#

hmmmmmmm i see