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

Items with an equippable component set to mainhand won't play the equipment sound if the item has switched to the active slot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.2 Pre-Release 1, 1.21.4
    • None
    • Community Consensus
    • Combat, Items, Sound
    • Low
    • Platform

      If an item has the equippable component with the field slot:mainhand, the equipment sound will not be played if the player switches the item to their active slot (through scrolling or by moving it in the inventory), however the sound will be played if said item is in the offhand through right clicking as its then equipped on the mainhand slot.

      This is inconsistent with the behavior of other equippable slots, as the other slots such as head or offhand will play the equipment sound by moving the item inside the inventory to the appropiate slot (such as armor or shields).

      How to reproduce

      1. Switch to survival.
      2. Give you this item:
        /give @s minecraft:totem_of_undying[minecraft:equippable={slot:mainhand,equip_sound:"item.totem.use"}]
        
      3. Equip it on your hand through the inventory or by scrolling the hotbar slot.

      Expected result
      As the item appears on the player's mainhand the custom equipment sound would be played.

      Observed result
      The item won't play the equipment sound, even though it's equipped in the mainhand.

        1. 2024-10-08_12.16.10.png
          2024-10-08_12.16.10.png
          142 kB
        2. 2024-10-08_12.16.13.png
          2024-10-08_12.16.13.png
          135 kB
        3. 2024-10-08_12.16.31.png
          2024-10-08_12.16.31.png
          141 kB
        4. 2024-10-08_12.16.35.png
          2024-10-08_12.16.35.png
          130 kB

            Unassigned Unassigned
            Chavamix700 syarumi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              CHK: