mojira.dev
MC-132938

Villagers don't accept datapack tags within "buy" recipes nbt

The bug

Villager's won't accept data tags within the "buy" nbt.

How to reproduce

Use a command such as this on a villager:

/data merge entity @e[type=minecraft:villager,limit=1,sort=nearest] {Offers:{Recipes: [{
    maxUses: 7, 
    buy: {id: "#minecraft:logs", Count: 1b}, 
    sell: {id: "minecraft:emerald", Count: 1b}, 
    uses: 0, 
    rewardExp: 1b
}]}
/data merge entity @e[type=minecraft:villager,limit=1,sort=nearest] {Offers:{Recipes: [{
    maxUses: 7, 
    buy: {id: "#minecraft:logs", Count: 1b}, 
    sell: {id: "minecraft:emerald", Count: 1b}, 
    uses: 0, 
    rewardExp: 1b
}]}

→ The villager should accept anything within the #minecraft:logs data tag, but denies any of them.

Comments 5

I wasn't entirely sure if this was a bug, but I figured I'd put it here since other NBT tags can accept data tags within them, such as "CanPlaceOn" and "CanDestroy".

This is a good idea, but feature requests do not belong on the bug tracker.

Allow me to clarify the CanDestroy situation: the bug was that including # (or any non-[a-z0-9_./] character) would crash the game. After fixing that crash, additional support was added for this particular case.

MukiTanuki

(Unassigned)

Community Consensus

buy, datapack, datapack-tag, tags, villager

Minecraft 1.13-pre6, Minecraft 1.13-pre7, Minecraft 1.13-pre8

Retrieved