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

/replaceitem command doesn't use correct slot numbers for main and off hand

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • Minecraft 15w42a
    • Minecraft 15w45a
    • None
    • Confirmed

    Description

      The slot numbers for main and offhand, as reported by /replaceitem, are 98 and 99. However, in reality, the offhand has slot number -106 and the main hand's slot number depends on the selected hotbar slot.

      To reproduce:

      /replaceitem entity @p slot.weapon.offhand stone
      /testfor @p {Inventory:[{id:"minecraft:stone",Slot:-106b}]}
      /testfor @p {Inventory:[{id:"minecraft:stone",Slot:99b}]}
      

      Observe how the second /testfor fails and the first one succeeds.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              redstonehelper [Mod] redstonehelper
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                CHK: