Listed example for KubeJS sifting recipe script does not work
vishtheshnu opened this issue ยท 26 comments
Describe the Bug
When creating a KubeJS server RecipeEvent script with the example basic sifting recipe, KubeJS throws an error:
[21:43:32] [ERROR] ! server_scripts:sifting.js:4: Failed to create recipe for type 'createsifter:sifting': Constructor for createsifter:sifting with 2 arguments not found!
[21:43:32] [WARN] server_scripts:sifting.js:4: Tried to call a function on an errored recipe! (Failed to create recipe for type 'createsifter:sifting')
Reproduction Steps
- Install latest versions of KubeJS (1902.6.1-build.348), KubeJS Create (1902.2.4-build.27), Create Sifter (1.19.2-1.6.1.c-36)
- Create KubeJS script of default example
event.recipes.createsifterSifting([Item.of('minecraft:clay').withChance(0.5).toJson(), Item.of('minecraft:redstone').withChance(0.1)], ['minecraft:sand','createsifter:string_mesh'])
Step 2 fails because it does not recognize .toJson(), but even after removing that I get the error listed in the above section.
Expected Result
KubeJS script should run without error and add the above recipe.
Screenshots and Videos
No response
Crash Report or Log
No response
Operating System
Windows 10
Mod Version
1.7.0.c-36
Minecraft Version
1.19.2
Forge Version
43.2.21
Other Mods
ad_astra-forge-1.19.2-1.12.7.jar
architectury-6.5.85-forge.jar
beJS-1.19.2-1.2.3.jar
botarium-forge-1.19.2-1.8.2.jar
cloth-config-8.3.103-forge.jar
Controlling-forge-1.19.2-10.0+7.jar
create_mechanical_extruder-1.19.2-1.5.0.c-36.jar
create-1.19.2-0.5.1.c.jar
createsifter-1.19.2-1.6.1.c-36.jar
ftb-library-forge-1902.4.1-build.236.jar
ftb-quests-forge-1902.5.3-build.258.jar
ftb-teams-forge-1902.2.14-build.123.jar
gtceu-forge-1.19.2-1.0.10.jar
item-filters-forge-1902.2.9-build.51.jar
javd-forge-4.0.1-build.2+mc1.19.2.jar
kubejs-create-forge-1902.2.4-build.27.jar
kubejs-forge-1902.6.1-build.348.jar
KubeJSREIRuntime-1.0.jar
kube-utils-forge-1.0.3+mc1.19.2.jar
laserio-1.5.2.jar
lava_sources_1.19.2_1.1.0.jar
LibX-1.19.2-4.2.8.jar
lootjs-forge-1.19.2-2.9.0.jar
MouseTweaks-forge-mc1.19-2.23.jar
Patchouli-1.19.2-77.jar
ponderjs-1.19.2-1.2.0.jar
PrettyPipes-1.13.6.jar
probejs-5.3.0-forge-hotfix.jar
REIPluginCompatibilities-forge-9.0.63.jar
resourcefulconfig-forge-1.19.2-1.0.20.jar
resourcefullib-forge-1.19.2-1.1.24.jar
rhino-forge-1902.2.2-build.268.jar
RoughlyEnoughItems-9.1.632.jar
scannable-MC1.19.2-forge-1.7.7+dc5ea09.jar
shutupexperimentalsettings-1.0.5.jar
SkyblockBuilder-1.19.2-4.2.15.jar
theoneprobe-1.19-6.2.2.jar
tinyredstone-1.19.2-4.1.5.jar
Additional Context
No response
I created a new world and the KubeJS scripts began working there. I namely copied over the waterlogged example and that that works fine, even when I remove .waterlogged().
The same script throws these same errors when I restart the game, even when it was working perfectly fine and created the desired effect beforehand.
You have to use the KubeJS 6.1 example for the 1.19.2 version of the mod.
Yup, I used the KubeJS 6.1 example and it's also throwing that error. Specifically the following is a basic example of a line that causes the same error:
event.recipes.createsifterSifting([Item.of('minecraft:clay').withChance(0.5)], ['minecraft:sand','createsifter:string_mesh'])
I also went through my logs, and I found these relevant lines:
[04Aug2023 16:07:41.626] [main/WARN] [mixin/]: Reference map 'createsifter.refmap.json' for createsifter.mixins.json could not be read. If this is a development environment you can ignore this message
...
[04Aug2023 16:07:47.398] [modloading-worker-0/ERROR] [KubeJS/]: Failed to load plugin com.oierbravo.createsifter.compat.kubejs.KubeJSCreatesifterPlugin from source createsifter: java.lang.ExceptionInInitializerError
I'm not able to reproduce the bug with only create, kubejs, kubejs-create and the sifter mod.
Can you plz send the full error mc log? and kubejs server log too.
Alright, so something I did while trying to find a fix broke it even further, and I'm going to start from an earlier working version of my pack and build back up from there. I'll let you know later today or tomorrow if I can recreate it as well, and what caused it. Sorry for throwing such a vague error on you, and thank you for the quick response!
Good news, I've figured out how to recreate the issue!
I had the KubeJS scripts set up and working fine, and then I installed the Wooden Hopper mod.
The first startup after installing it worked fine as well, but after closing and loading up the game again, none of the createsifter KubeJS scripts were recognized. This includes the custom mesh creation function which failed on startup, and even after removing that, the custom sifting scripts on server-side scripts.
Removing the mod made it work again, thankfully.
I have no clue what could be causing the issue, or how a mod as simple as Wooden Hoppers could cause this, but I hope this will help you reproduce the issue and figure out what's going on. Thanks!
Other mods I had installed the first time the problem occurred are: Scannable, Pretty Pipes, and JAOPCA. They might not all also be causing this issue, but it's likely at least one of them might have the same behavior as Wooden Hoppers.
its cool that you have found the problem but im having the same issue here and i have around 170 mods and probably will not find the mods causing the problem
Update: this behavior is happening now whenever I add any new mod to my modpack. Tree Squat Grow, Simple Graves, etc.
The only cause I can think of is that this only started after I added createsifter kubejs scripts. Going to experiment and see if removing them first helps.
Hi!
I'm blind without logs (mc and kubejs) and some steps or a way to reproduce the error.
in the server.log I can see:
[18:41:25] [ERROR] ! #3: Error occurred while handling event 'ServerEvents.recipes': TypeError: Cannot find function toJson in object 'minecraft:redstone'. (server_scripts:createsifter.js#3)
you have to use the 6.1 example
in the server.log I can see:
[18:41:25] [ERROR] ! #3: Error occurred while handling event 'ServerEvents.recipes': TypeError: Cannot find function toJson in object 'minecraft:redstone'. (server_scripts:createsifter.js#3)
you have to use the 6.1 example
btw i have errors because i havent updated my server scripts yet
can you plz send the
latest.log
anddebug.log
from minecraft?
latest.log
startup.log
and there is no debug log
plz try with 1.7.0.c-36
:
StartupEvents.registry('item', event => {
event.create("test","createsifter:mesh").displayName("Amethyst mesh")
.parentModel("createsifter:block/meshes/mesh")
.texture("createsifter:item/custom_mesh")
.texture("mesh","kubejs:item/test")
.texture("frame","kubejs:item/test")
.texture("particle","kubejs:item/test");
});
texture is invalid as it doesn't exist but the mesh is generated.
client.log
latest.log
and ive made a texture in the file location kubejs\assets\kubejs\textures\item\test.png
Have you tried with the code above?
It works for me.
I'm not able to reproduce the bug.
Can you plz send me the pack in a zip so I can do more testing.
My discord user is the same. You can find my in the kubejs and create servers.
So far it's working well! I'll update if anything else comes up, thank you so much!