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

Dispenser plays failed sound when equipping a single pumpkin or skull

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 19w42a
    • Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w20c, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w47a, Minecraft 18w47b, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04a, Minecraft 19w07a, Minecraft 19w11a, Minecraft 19w12a, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3, Minecraft 1.14 Pre-Release 5, Minecraft 1.14.2 Pre-Release 3, Minecraft 1.14.3 Pre-Release 3, Minecraft 1.14.3 Pre-Release 4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b
    • Confirmed
    • (Unassigned)

      The bug

      Dispensers play the dispensing failed sound when they equip a single pumpkin or skull.

      How to reproduce

      1. Activate subtitles
      2. Put a stack of multiple pumpkins or skulls in a dispenser
      3. Stand in front of the dispenser and activate it
        It will play the sound when an item was successfully dispensed and show the subtitle "Dispensed item"
      4. Put only a single pumpkin or skull in the dispenser and unequip the one you are currently wearing
      5. Stand in front of the dispenser and activate it
        It will play the sound when an item was not successfully dispensed and show the subtitle "Dispenser failed"

      Code analysis

      Based on 1.11.2 decompiled using MCP 9.35 rc1

      The respective methods set the field net.minecraft.init.Bootstrap.BehaviorDispenseOptional.successful to false it the item returned after dispensing is "empty". Instead they should set it to false only if the count did not change.
      Additionally the method net.minecraft.item.ItemArmor.dispenseArmor(IBlockSource, ItemStack) should probably return the item if not entity can be equipped instead of returning an empty item.
      The method net.minecraft.item.ItemArmor.DISPENSER_BEHAVIOR.new BehaviorDefaultDispenseItem() {...}.dispenseStack(IBlockSource, ItemStack) should then test as well if the count did not change.

            cojomax99 [Mojang] Cory Scheviak
            Awesoman3000 Connor Steppie
            Votes:
            6 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: