Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-108074

Receiving item from villager counts as crafting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.10.2, Minecraft 16w39c, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w12b, Minecraft 19w13b, 1.15.2, 1.16.1, 20w29a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2, 20w46a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w08b, 21w11a, 1.17, 1.17.1, 1.18.1, 1.18.2, 1.19, 22w24a, 1.19.2, 1.20.1
    • Confirmed
    • Statistics
    • Low
    • Platform

      The bug

      When you trade an item with a villager the crafting stat for the received item increases.

      How to reproduce

      1. Summon a villager
        /summon villager ~ ~ ~ {NoAI:1b,Offers:{Recipes:[{buy:{id:"stone",Count:1b},sell:{id:"stone",Count:1b},maxUses:2147483647}]}}
        
      2. Setup the scoreboard objective
        /scoreboard objectives add craftedStone minecraft.crafted:minecraft.stone
        /scoreboard objectives setdisplay sidebar craftedStone
        
      3. Trade with the villager
        → The score increases

      The reason

      The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

      The method net.minecraft.inventory.SlotMerchantResult.onCrafting(ItemStack) calls the method net.minecraft.item.ItemStack.onCrafting(World, EntityPlayer, int).

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            14 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              CHK: