KubeJS

KubeJS

61M Downloads

Cannot make custom item lose durability in a crafting recipe

Abalieno opened this issue ยท 4 comments

commented

Minecraft Version

1.18.2

KubeJS Version

kubejs-fabric-1802.5.5-build.546

Rhino Version

rhino-fabric-1802.2.0-build.232

Architectury Version

architectury-4.9.84-fabric

Forge/Fabric Version

fabric-api-0.59.0+1.18.2

Describe your issue

ruyk

The commented out code works, but I need this to be shapeless.

I've tried various combinations of the line below, none worked. The item always gets deleted.

I've tried with or without NBT, within and without the damageIngredient part. I've tried adding keepIngredient.

Even through lots of trial and error I still couldn't make it work as it should.

Also, when I commented out the shapeless recipe and added the shaped one, and reloaded through "/kubejs reload server_scripts" + "/reload"
the shapeless recipe would stay active, and the shaped one still disabled. Until I closed everything and restarted.

The item was created with a simple:
event.create('geggy:wooden_form', 'basic').displayName('Wooden Form').maxDamage(50);

Crash report/logs

No response

commented

I found another bug:

the following shaped recipe works as it should if done over a crafting table (the item is returned, durability decreased by 1):

rtyjtyuj

But if I do the same in the character crafting slots, the mortar is deleted.

(the sand tag is only in modded, I replaced it with just a minecraft sand block, same behavior)

commented

As further, even if pointless, reporting... replaceIngredient is also broken:

iuliol

I tried different combinations, the items always get deleted and not replaced.

I replaced the custom mortar with minecraft:sticks and the command worked. So it's support for kubejs items that's completely broken.

On the other hand, keepIngredient also follows the bugged behavior above. It works in a shaped position where I use the number of the slot, but the item is deleted if the recipe is done outside a crafting table.

That means none of these commands work: replaceIngredient, damageIngredient, keepIngredient

commented

Duplicate of #239

commented

Closing this myself, and adding a bandaid workaround in case someone else searches for a similar issue:

ryhjy

This has been tested and it works as it should.
It's done by adding crafttweaker and using its script. Not an elegant solution, but at least it works.