KubeJS

KubeJS

69M Downloads

recipes with NBT doesn't work

Ruanxingzhi opened this issue ยท 2 comments

commented

Minecraft Version

1.19.2

KubeJS Version

kubejs-fabric-1902.6.0-build.142

Rhino Version

rhino-fabric-1902.2.2-build.264

Architectury Version

architectury-6.4.62-fabric

Forge/Fabric Version

Fabric 0.14.13

Describe your issue

Consider this axe:

image

Command /give @a minecraft:diamond_axe{Damage:123} works as expected.

This kubejs script doesn't give a correct diamond axe:

event.shaped(Item.of('minecraft:diamond_axe', '{Damage:123}'),
	'B',
	{
		B: 'minecraft:iron_axe'
	})

image

These fail too:

Item.of('minecraft:diamond_axe', {Damage:123})
Item.of({item: 'minecraft:diamond_axe', nbt:'{Damage:123}'})

However, it seems that it is fine in 1.18. I copied the script below from Create:Astral (modpack in 1.18), and find it doesn't work in 1.19.

event.shaped(Item.of('computercraft:turtle_normal', {RightUpgrade:"minecraft:diamond_pickaxe"}),
  'BAC',
 {
  A: 'computercraft:turtle_normal',
  B: 'minecraft:iron_pickaxe',
  C: 'minecraft:diamond'

})

Crash report/logs

No response

commented

Fabric has always been funky with NBT.
They now have an actual ingredient api, so once KJS implements that properly this should be resolved.
Create: Astral probably worked cause I'm guessing thats a forge pack

See below

commented

Not the actual issue, the behaviour of ingredients has changed slightly so ingredients from item stacks now ignore nbt by default. Use .weakNBT() or .strongNBT() to get an ingredient that will filter by NBT