when the item's NBT data contains nested structures
fafaovo opened this issue ยท 1 comments
minecraft version : 1.16.5 custom-machinery : Custom-Machinery-1.16.5-0.5.8m
I would like to convey that within the kubejs script, the function .produceItem(Item) supports the use of kubejs's Item.of(). However, when the item's NBT data contains nested structures, there appears to be an issue with the item not being produced correctly.
for example
event.recipes.custommachinery.custom_machine("custommachinery:constellation_observatory", 80)
.requireItem('astralsorcery:parchment')
.produceItem(Item.of('astralsorcery:constellation_paper', '{astralsorcery:{constellationName:"astralsorcery:discidia"}}'))
This is a star map from Starlight magic
He cannot be produced normally,Even if you can see it in JEI
I think it might be a BUG
So I took an alternative solution
event.recipes.custommachinery.custom_machine("custommachinery:constellation_observatory", 80)
.requireItem('astralsorcery:parchment')
.produceItem(Item.of('astralsorcery:constellation_paper', '{astralsorcery:{constellationName:"astralsorcery:discidia"}}'))
.requireFunctionOnEnd(ctx => {
ctx.machine.addItemToSlot(
"output2",
'astralsorcery:constellation_paper', '{astralsorcery:{constellationName:"astralsorcery:discidia"}}',
false);
return Result.success()
})
This method can be used normally
But it's weird