I'm trying to have a custom villager trade be: input a shulker box with 1 stone in the first slot, to receive 1 stone. I plan to have the trade be other things, but I can't get this fundamental trade to work.
The villager's trade gui seems correct, he properly asks for a white shulker box with a tag of 1x stone. However, when trying to give him a white shulker box with 1 stone in slot 0, or any slot for that matter, he won't accept it.
I've done the reverse and made him sell me the shulker box by giving him 1 stone, and I receive a white shulker box with 1 stone in slot 0. Strangely enough, he accepts the exact shulker box he sold me as input for the first trade, despite there being no differences from a box I create. If I take the box he sold me, take the stone out, and put it back in, then he won't accept it as input for the first trade.
Are villagers unable to properly check contents of a shulker box? Or is there some other hidden data that needs to be established? Any help would be appreciated.
Apparently, I had to add the "minecraft:" prefix to id names, and add the Damage:0s tags. He now accepts player-made shulker boxes.
Yep. Whenever you test for nbt in entities, they have to be prefixed and suffixed correctly.
All items must have the "minecraft:item" format
Counts, Slots, etc are a BYTE (b)
Motion, direction, etc are DOUBLES (d)
and so on and so forth