mojira.dev
MC-166959

Can't trade with villager after clicking on them while holding a written book.

This is a very odd one....

Summon the villager like this:

execute align xyz run summon minecraft:villager ~0.5 ~ ~0.5 {VillagerData:{profession:"minecraft:nitwit",level:6},Offers:{Recipes:[{rewardExp:1b,xp:2,maxUses:1000000,buy:{id:"minecraft:stone",Count:1b},sell:{id:"minecraft:written_book",Count:1b,tag:{author:"Test",title:"Test",bclott_tid:0,bclott_action:"ticket",pages:['{"nbt":"Inventory[{Slot:0b}].id","entity":"@s"}']}}}]}}

Trade him a stone for a book, open the book while looking at the villager.

The villager can now not be traded with.

The duration of this state varies, sometimes you can trade on a second attempt, sometimes it seems like it's never going to become tradeable again.

Linked issues

Comments 4

Alex Smith’s comment on MC-141494 describes more effects of right-clicking on a villager with a signed written book.

The command provided in the description was so long that copying and pasting didn’t paste the whole command, so I tested this with the command from MC-141494 instead.

/summon villager ~ ~1 ~ {NoAI:1,Offers:{Recipes:[{buy:{id:air,Count:0},sell:{id:air,Count:0}}]}}

I was able to successfully reproduce this every time with the villager from that command. I also tried to reproduce this with villagers from spawn eggs (that I had provided work stations for) but reproduction was unreliable with them.

This might be a client-server desync because this bug can also be used to create “ghost” items.

  1. Put something in your off-hand.

  2. Have a signed written book and an empty space on your hotbar.

  3. Right-click on the villager while holding the written book.

  4. Select the empty space on your hotbar.

  5. Press the hotkey that switches items between you main-hand and your off-hand.

  6. The real item is now in your main-hand and a duplicate “ghost” item is in your off-hand.

  7. The “ghost” item can disappear by itself at any moment and if it was a block, it will disappear when you place it.

Fixed in 1.16 Pre-release 2 or earlier.

Bertie

(Unassigned)

Community Consensus

(Unassigned)

1.14.4, 1.15.2

1.16 Release Candidate 1

Retrieved