#What is wrong with this script?

16 messages · Page 1 of 1 (latest)

narrow basin
#

It doesn't show any errors, it's just like the recipe doesn't exist. I don't see it in JEI and I cannot craft it. What's wrong?

ServerEvents.recipes(event => {
    event.shapeless('minecraft:iron_ingot', [
        'kubejs:hammer',
        'minecraft:iron_nugget',
        'minecraft:iron_nugget',
        'minecraft:iron_nugget',
        'minecraft:iron_nugget',
        'minecraft:iron_nugget',
    ])
    .damageIngredient('kubejs:hammer'); 

    event.shapeless('minecraft:gold_ingot', [
        'kubejs:hammer',
        'minecraft:gold_nugget',
        'minecraft:gold_nugget',
        'minecraft:gold_nugget',
        'minecraft:gold_nugget',
        'minecraft:gold_nugget',
    ])
    .damageIngredient('kubejs:hammer'); 

    event.shapeless('create:zinc_ingot', [
        'kubejs:hammer',
        'create:zinc_nugget',
        'create:zinc_nugget',
        'create:zinc_nugget',
        'create:zinc_nugget',
        'create:zinc_nugget',
    ])
    .damageIngredient('kubejs:hammer'); 

    event.shapeless('create:brass_ingot', [
        'kubejs:hammer',
        'create:brass_nugget',
        'create:brass_nugget',
        'create:brass_nugget',
        'create:brass_nugget',
        'create:brass_nugget',
    ])
    .damageIngredient('kubejs:hammer');
});
abstract bayBOT
#

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

vapid marshBOT
#

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

warped moon
#

You might have to set the file that makes the kubejs:hammer at a higher priority so that it actually exists when this script tries to use it.

woven lichen
#

those events happen at different times, and during different events

#

priority wont do anything

warped moon
#

My final guess is that the ids may be scuffed, but that's my final guess because I imagine they would've been found the problem then.

woven lichen
#

cant see anything wrong iwth the code, other than spamming nugget instead of just putting 5x xD

warped moon
#

Yeah

#

Well, if it were me, I'd imagine one of the ingredients just wasn't typed in correctly and since it can't find it, no recipe.

narrow basin
#

uh so I figured out what was wrong (Im just dumb af). Anyway, how can I make it use 2 durability on the hammer instead of 1?

woven lichen
#

What was the issue?

#

And add 2 as a second parameter to the damage function

narrow basin
narrow basin