KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
299 stars 89 forks source link

[Fabric] [1.19.2, 1.20.1] NBT in crafting results does not work in Fabric #711

Open adumbrali opened 9 months ago

adumbrali commented 9 months ago

Minecraft Version

1.19.2, 1.20.1

KubeJS Version

Fabric 1902.6.2-build.15, Fabric 2001.6.3-build.47

Rhino Version

Fabric 1902.2.2-build.272, Fabric 2001.2.2-build.6

Architectury Version

v6.5.85, v9.1.12

Forge/Fabric Version

Fabric 43.3.0, Fabric 0.14.22

Describe your issue

Create simple shapeless recipes that include NBT. I tried with 1.19.2 and 1.20.1, but both do not include NBT when using Fabric.

ServerEvents.recipes(event => {
  event.shapeless(
    Item.of('minecraft:stone_sword', '{Damage:20}').strongNBT(),
    [Item.of('minecraft:wooden_sword', '{Damage:20}').strongNBT()]
  )
})

Using .weakNBT() instead did not change the recipe. 2023-09-27_04

Crash report/logs

No response

Hunter19823 commented 4 months ago

I looked into why this happens, it seems to be that the ShapelessRecipe's static function for getting an ItemStack from Json does not read NBT tags when they are present in the result. image