KubeJS

KubeJS

69M Downloads

Failure to load correctly

McMonak opened this issue ยท 10 comments

commented

Minecraft Version

1.18.2

KubeJS Version

1802.5.5-build.569

Rhino Version

1802.2.1-build.255

Architectury Version

4.11.93

Forge/Fabric Version

Forge 40.2.17

Describe your issue

I tried to add custom integrations for mystical agriculture (one plant) and interactions between mystical agriculture/aggraditions and immersive engineering garden cloche. When the loading is done it blocks and displays a screen that says it failed to load.
Here is the crash log, any help would be gladly taken.
crash-2024-02-08_09.34.05-fml.txt

Crash report/logs

(https://pastebin.com/WgX3B2pT)

commented

You have errors in your Startup Scripts, that is the cause of your crash.

commented

You have errors in your Startup Scripts, that is the cause of your crash.

in the startup logs of kubejs there's this : [09:33:53] [ERR ] Error loading KubeJS script: ReferenceError: "events" is not defined. (startup_scripts:blocks.js#1)
[09:33:53] [INFO ] Loaded 0/1 KubeJS startup scripts in 1.557 s

commented

Your code is not inside an Event. https://kubejs.com/wiki/events

commented

as footer said, there's an issue with your startup script and not kubejs itself

commented

i have only 1 startup script : events.listen('block.registry', function (e) {
e.create('alfsteel_crux').material('rock').hardness(0.5).displayName('Alfsteel Crux')
})

commented

Never use AI for KubeJS, it doesn't know anything about it.
Read the wiki.

commented

Never use AI for KubeJS, it doesn't know anything about it. Read the wiki.

i didn't ? All the kubejs code and stuff comes from a guy that knows how to use it so I surely messed up somewhere

commented

Never use AI for KubeJS, it doesn't know anything about it. Read the wiki.

So should I use this I found on the wiki and add my values ? : StartupEvents.registry('block', event => {
event.create('example_block') // Create a new block
.displayName('My Custom Block') // Set a custom name
.soundType('wool') // Set a material (affects the sounds and some properties)
.hardness(1.0) // Set hardness (affects mining time)
.resistance(1.0) // Set resistance (to explosions, etc)
.tagBlock('my_custom_tag') // Tag the block with #minecraft:my_custom_tag (can have multiple tags)
.requiresTool(true) // Requires a tool or it won't drop (see tags below)
.tagBlock('my_namespace:my_other_tag') // Tag the block with #my_namespace:my_other_tag
.tagBlock('minecraft:mineable/axe') //can be mined faster with an axe
.tagBlock('minecraft:mineable/pickaxe') // or a pickaxe
.tagBlock('minecraft:needs_iron_tool') // the tool tier must be at least iron
})

commented

No, that is 1.19 syntax. You need to use 1.18 syntax.

commented

please don't use the github issues for support, go to https://discord,gg/lat for that instead