#I'm struggling with the creation of custom recipes for very specific items

6 messages · Page 1 of 1 (latest)

copper geyser
#

Hello! So, I'm having issues to create custom recipes for items using their NBTs for extremely specific items. Common items like cobblestone are easy, but items with specific details like enchantments or damage on durability are being a problem for me. To put it simply: how do I put items with their full NBT as outputs for custom recipes?

ServerEvents.recipes(event => {
    event.recipes.ars_nouveau.enchanting_apparatus(
        ['minecraft:heart_of_the_sea', 'minecraft:nautilus_shell', 'minecraft:nautilus_shell', 'minecraft:nautilus_shell'], // input items
        'minecraft:gold_block', // reagent
        'minecraft:iron_chestplate{Damage: 0, Enchantments: [{lvl: 2s, id: "minecraft:unbreaking"}]}', // output
        1000 // source cost
        // true // keep nbt of reagent, think like a smithing recipe
    )
})

Above is an example of a recipe that doesn't work. I know the problem is not the NBT on itself because I tested it with a command /give and the game gave me exactly an iron chestplace with unbreaking 2

whole warrenBOT
#

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

ocean locust
#
ServerEvents.recipes(event => {
    event.recipes.ars_nouveau.enchanting_apparatus(
        ['minecraft:heart_of_the_sea', 'minecraft:nautilus_shell', 'minecraft:nautilus_shell', 'minecraft:nautilus_shell'],
        'minecraft:gold_block',
        Item.of('minecraft:iron_chestplate', '{Enchantments:[{lvl:2s,id:"minecraft:unbreaking"}]}'),
        1000
    )
})

you can get the Item.of() from holding the item in your hand and typing /kubejs hand

#

you can also remove irrelevant nbt like the damage

copper geyser
#

Ooooh, got it. Thank you very much!😊