mojira.dev
MC-164353

Villager GUI closes instantly when using custom trades on a villager with no profession and with AI

when adding custom trades to a villager with no profession and no trades using /data modify, when he is clicked, the gui appears and closes instantly, the trade is there because the villager will have the item holding behavior and if there is a lag spike during the click, the gui might be visible for a second

 

exact command:

/data modify entity (villager) Offers.Recipes append value 
{maxUses: 10000,
buyB: {id: "minecraft:stone", Count: 1b},
buy: {id: "minecraft:stone", Count: 1b},
sell: {id: "minecraft:stone", Count: 1b},
xp: 0, uses: 0, specialPrice: 0, rewardExp: 0b}

this only affects villagers without a profession and with AI

/summon command

/summon villager ~ ~ ~ {VillagerData:{profession:"minecraft:none"},Offers:{Recipes:[{maxUses:100,buyB:{id:stone,Count:1b},buy:{id:stone,Count:1b},sell:{id:stone,Count:1b}}]}}

Related issues

Attachments

Comments

migrated
[media][media][media]
violine1101

Please provide the exact command.

anthony cicinelli

Command Fails to work in 19w42a

marcono1234

If you hold the desired item (in this case stone), the villager will show the item he sells.
Though as described the trading GUI closes instantly.

migrated

Relates to MC-169755

 

Confirmed for 1.15.2 prerelease 1 and 1.15.1

blablubbabc

Can confirm for 1.16.5

Avoma

Can confirm in 21w03a.

migrated

Additionally, if the jobless villager is also set to have a specific level when summoned, it will retain this level when it aquires a profession. It will however not maintain the customized trades but instead offer trades from the current level it has but not the previous level trades.

Example: summon a jobless villager with level 2 and then make it a cleric by placing down a brewing stand, it will now start as a level 2 cleric but not offer the zombieflesh trade nor the redstone one.

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.18.2 and 22w12a. Here's a video of this issue occurring.

[media]

Due to the GUI being opened for a split second, the screen flashes so if you suffer from photosensitive epilepsy, I'd recommend not watching it just to ensure that no harm is done. 🙂

Avoma

Can confirm in 1.19.

Avoma

Can confirm in 1.19.2 and 22w42a.

Brain81505

Can confirm in 23w03a

[Mod] Jingy

Can confirm in 23w45a

migrated

(Unassigned)

Confirmed

Platform

Low

Commands, Trading

trading, villager

1.14.4, 19w42a, 1.15.1, 1.15.2 Pre-release 2, 1.16.2 Release Candidate 1, ..., 22w42a, 23w03a, 1.20.1, 23w45a, 1.21

Retrieved