#Are there any mods / libraries that are known to cause problems with KubeJS?

1 messages · Page 1 of 1 (latest)

maiden otter
#

I am having issues with a script, and I know it's a mod because the same script works in a cleaner enviroment. I already know about hammer lib but that one isn't installed. If necessary, I'll post the mod list, though it's 292 mods.

grim phoenixBOT
#

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

maiden otter
#

ah I'll also post the script just to be sure

swift cliffBOT
#

Paste version of harderWood.js from @maiden otter

maiden otter
#

I'm thinking it could also have to do with the priority but I am not sure

radiant widget
#

??kjslogs

swift cliffBOT
# radiant widget ??kjslogs

You can find your KubeJS server log here. You should send it if asked, as it contains helpful information: minecraft/logs/kubejs/server.log
If you are on 1.18 or below it will be called server.txt.

maiden otter
swift cliffBOT
#

Paste version of server.txt from @maiden otter

maiden otter
#

oh yeah I should have added the log too, it shows that for some reason it reads barriers

hasty bramble
#

log strippedLog before making the recipe then send the log again

maiden otter
#

doesn't it already do that?

#

ah I suppose not

#

it does it later

#

wait but that shouldn't effect it now should it

hasty bramble
#

the error is the output is undefined

#

the source of the output is that array

maiden otter
#

like this?

        // multiple items
        else if (typeof woodlog === 'object') {
            cyc.logOnce('This seems to be an array of items.');
            let strippedLogList = woodlog.itemIds.filter(item => /.*stripped.*/.test(item));
            let strippedLog = strippedLogList.filter(item => /.*log.*/.test(item));
            let unstrippedLog = woodlog.itemIds.filter(item => /.*(?!.*stripped).*log.*/.test(item));
            
            cyc.logOnce(strippedLog) // <------------------------------ here
            if (strippedLogList.length == 0) {
                console.log('Planks Recipe creation skipped for: ' + woodlog);
                return;
            }
            cyc.logOnce(strippedLogList)
            event.shapeless(`4x ${plank}`, Ingredient.of(strippedLogList)).id(r.getOrCreateId());

            if (false){ // [17:22:26] [ERR  ] server_scripts:harderWood.js:49: Failed to create recipe for type 'kubejs:shapeless': dev.latvian.mods.rhino.Undefined@0 is not a valid result!
                console.log('Logs Recipe creation skipped for: ' + woodlog);
                return;
            }
            event.shapeless(strippedLog[0], unstrippedLog[0]);
        } 
hasty bramble
#

what is your cycle thing

maiden otter
#

wdym

hasty bramble
#

i have never seen the syntax cyc.logOnce

maiden otter
#

oh yeah it's a function I made to only log something one time, it's a little hacky though

hasty bramble
#

then its useless

#

cause the first recipe isnt erroring

#

unless it is and i missed something

maiden otter
#

the first one seems to be erroring too:

[20:00:02] [INFO ] server_scripts:libraries/logutils.js:14: log 2/4: byg:skyris_planks
[20:00:02] [INFO ] server_scripts:libraries/logutils.js:14: log 3/4: This seems to be an array of items.
[20:00:02] [INFO ] server_scripts:harderWood.js:42: Planks Recipe creation skipped for: [Item.of('minecraft:barrier', "{display:{Name:'{\"text\":\"Empty Tag: byg:skyris_logs\"}'}}")]
[20:00:02] [INFO ] server_scripts:libraries/logutils.js:14: log 4/4: ['twilightforest:mangrove_log'] ```
hasty bramble
#

those are all info logs

#

made by your script

maiden otter
#

yes but in game the recipe doesn't work.

#

so they're working

#

as in they're giving me information on wether a recipe failed or not

#

if it fails it skips, simple as

#

(normally it's supposed to skip some, as some logs don't have planks etc.)

hasty bramble
#

but it is creating bad recipes which are erroring
so you obviously arent skipping enough recipes.

maiden otter
#

listen all I know is that the script here is later in queue for things I'm looking for

#

all I know is that it works when I have less mods, and it stops working with more mods

hasty bramble
#

by logging the thing that is erroring you snould be able to figure out what condition you need to check to skip the bad recipes

#

so log (using a standard log statement) the strippedLog array just before the recipe creation on line 57

#

then send the log, or have a look at it yourself, to see what the array looks like for the recipes throwing errors

maiden otter
#

wait, line 57?

#

after event.forEachRecipe closes?

hasty bramble
#

sorry 52

maiden otter
#

ah alright

#

it'll take a while to open but I'm coming back in a sec

swift cliffBOT
#

Paste version of server.txt from @maiden otter

maiden otter
#

hmm

#

as expected if it skips it returns

#

so the log is not shown unless the recipe works

#

I should move it back igg

hasty bramble
#

no?

#

thsi recipe is erroring

#

and you can see the cause is the array youu are getting the ingredient from is empty

maiden otter
#

I feel like you're looking at the wrong stuff

#

that was an error that happened when the script worked too

#

I was trying to figure out why - if I remember correctly it was because of some recipes having separate log recipes - but it doesn't seem to relate

#

after all, recipes such as the skyris planks get skipped but don't have that error

hasty bramble
#

so what is your actual issue?
all you have said is 'this doesnt work' and thenmsent the log and script

maiden otter
#

it's exactly that

#

it doesn't work on most recipes

hasty bramble
#

so that is the information i am working off, starting with the first error in the log

maiden otter
#

on a large modpack

#

on a small modpack it works

#

I'm trying to find the mod that's causing it

hasty bramble
#

if that is your goal do a binary search

#

??tils

#

??tips

swift cliffBOT
# hasty bramble ??tips

A binary search is a way of finding a faulty mods/scripts when you have a lot of them, but without having to remove them one-by-one.

The procedure is simple:

  • Take half of the existing mods/scripts and move them out, into another folder.
  • Run the game.
  • Does the issue still exist?
    If YES: Repeat from step 1 with the current things.
    IF NO: Swap out the current things with the ones you moved out, and repeat from step 1.
  • Repeat this process until the problematic mod(s)/script(s) have been found.
maiden otter
#

with 292 mods I doubt I can do binary search in a reasonable amount of time

hasty bramble
#

well its more reasonable that removing them one by one

#

will still take a good 30-60 minutes,but its more productive t an trying to get suppot without providing enough information

maiden otter
#

so far someone suggested it might be hammer lib, though that was on another pack and this one doesn't have it

#

so I should look into what hammer lib does, so maybe I could figure out what other library or mod does the same

#

and then my search would be easier

maiden otter
#

after all I have to disable half of the mods one by one, then run minecraft, then check, then close minecraft, then do the process again

#

in short, binary search is unfeasable

hasty bramble
#

hammer lib mixins to kubejs
it is the only mod known to do that (apart from maybe modern fix,but that is okay aiui cause the author is actually in the server)

maiden otter
#

in this case

#

the same mod creator that made hammerlib seems to have made libraries for microblocks and multiparts

#

my modpack has CB Multipart, which is a new mod that does essentially the same thing

#

considering that the microblock and multipart mods have hammer lib as their dependency it is possible that CB Multipart might have integrated parts of it within the code

#

so I'll try disabling that and the project red mods

#

I'll tell you if I find something new

hasty bramble
#

check your logs for a passive agressive message from the hammerlib author

maiden otter
#

latest.log ?

radiant widget
hasty bramble
#

if its there, then theres like a 0.5% chance that one of his mods is causing a problme
if its not there, its about a 0.05% chance

radiant widget
#

it will be something like

#

hello kubejs this is your "friend" hammerlib

#

I've injected x recipes into your flawed recipe system

#

or smth

maiden otter
#

I could not find something like that in the logs

#

I will try to disable the mod anyways just to check

hasty bramble
#

If that doesnt work, can you start from scratch explaining your problem. dont assume the solution this time though ('removing mods' is a solution)

#

??xy

swift cliffBOT
# hasty bramble ??xy

The XY problem is when you really want to do X, and you think that Y can achieve X. However, you can't get Y to work, and so ask for help exclusively about Y.

This can lead to a lot of confusion from the people trying to help you, as Y can seem like a very random thing to want to do, and a lot of the time isn't the best way to achieve X anyway.

Its fine to ask about Y, just always include some context about X so you can be put on the right track if Y won't do X well, or there is an easier way to do X.

hasty bramble
#

you havent given enough information about X, but you have kept trying to push Y

maiden otter
#

I will explain in the meantime

#

I made a script for autonomous planks recipe creation on a pack with a few mods as to avoid having to load every single one every time, and when I found that it worked, I transferred it over to my larger pack, where unfortunately (with the same code) it stopped working.

#

I had copied the script on another pack I am working on too, and it had the same results, but someone told me it could've been hammer lib, which unforunately isn't in the main pack I'm making

#

which is the reason I had been assuming a library to be causing this

#

also unfortunately disabling CB multiblock didn't work

#

multipart*

hasty bramble
#

what do you mean by 'stopped working'.
there are errors in your log,but you said before that those are not related (btw posting logs with unrelated errors is incredibly unhelpful. try stop the errors from happening before asking for help)

#

if you need help stopping those errors, ask

maiden otter
#

if you want I can also tell you what the script does

#

it takes the log -> planks recipes, and modifies them so that you can only use stripped logs

#

can't remember if it straight up modifies them or just removes and replaces them though

#

probably the latter