Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-5351

Villager Trades by buying items with custom names not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version git-Spigot-94af569-a3fdef8 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
    • Yes

      When you make a villager buy something with a custom name, you will not be able to successfully trade with the villager. In the client, it appears that the trade went though, but the items "rubber band" back into the player's inventory.

      My guess is that the string when an Item has color is not exactly the same when comparing it in the Villager's inventory, or that maybe it's not being deserialized correctly

      Summon Command for the Villager:

      /summon villager ~ ~1 ~ {
      VillagerData:

      { profession: shepherd, level: 5, type: savanna }

      ,
      Invulnerable: 1,
      PersistenceRequired: 1,
      Offers: {
      Recipes: [{
      buy:

      { id: diamond, Count: 1 }

      ,
      buyB: {
      id: ghast_tear,
      Count: 1,
      tag:{
      CustomModelData:204002,
      display: {
      Name: '

      {"text":"Soul of Light","color":"light_purple"}

      ',
      Lore: ['

      {"text":"The essence of light creatures"}

      ']
      }
      }
      },
      sell:

      { id: fox_spawn_egg, Count: 1 }

      ,
      maxUses: 9999999
      }]
      },NoAI:1
      }

      Command to summon the item:

      /give @p minecraft:ghast_tear{display:{Name:'

      {"text":"Soul of Light","color":"light_purple"}

      ',Lore:['

      {"text":"The essence of light creatures"}

      ']},CustomModelData:204002} 1

      Same commands do work in Vanilla Minecraft on a local world

      Let me know if you need any other info!

            Unassigned Unassigned
            philip-scott Felipe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: