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

Switching items at the same time as attacking ignores the item attributes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w31a, Minecraft 1.8.1-pre3, Minecraft 1.8.8, Minecraft 1.11.2, Minecraft 17w13b, Minecraft 17w17b, Minecraft 17w18b, Minecraft 18w03b
    • Fix Version/s: None
    • Confirmation Status:
      Confirmed
    • Category:
      (Unassigned)

      Description

      The bug

      If you switch items in your hotbar at the same time as attacking, attributes are not applied on the item you switch to.

      • What I expected to happen
        I expected to kill a cow in one hit after switching to a diamond sword at the same time as I attacked it.
      • What actually happened
        Side effects of using the diamond sword still occurred, except not the item's damage. This means that the sword still lost durability and the fire aspect enchantment still set the cow on fire, but it did not die in one hit (cows have 10 health, the diamond sword has +9999 attack damage).

      Steps to reproduce

      1. Spawn a cow
      2. Take a sword enchanted with fire aspect and with a high damage and speed and place it in a certain slot in your hotbar (I used 4, i.e. I hit the 4 key to select it)
        /give @p minecraft:diamond_sword 1 0 {AttributeModifiers:[{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:9999.0d,Operation:0,UUIDLeast:307806,UUIDMost:856305,Slot:"mainhand"},{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:1024.0d,Operation:0,UUIDLeast:307800,UUIDMost:856300,Slot:"mainhand"}],ench:[{id:20s,lvl:1s}]}
        
      3. Leave another slot with nothing, and select that slot.
      4. Left-click the cow at the exact same time you hit the 4 key (or whatever slot you chose for the sword.)
      5. The cow will be set one fire and the sword will lose durability, but the cow is not instantly dead.

      Notes:

      • This works in creative and survival, but it was easier to show the sword's durability loss in survival.
      • The sword doesn't need any enchantment. It's just easier to show that you're actually using the sword when you attack if it has one.

        Attachments

        1. 2013-08-07_20.32.59.png
          2013-08-07_20.32.59.png
          128 kB
        2. 2013-08-07_20.33.07.png
          2013-08-07_20.33.07.png
          144 kB
        3. 2013-08-07_20.47.21.png
          2013-08-07_20.47.21.png
          82 kB
        4. 2014-08-04_14.16.21.png
          2014-08-04_14.16.21.png
          167 kB
        5. 2014-08-04_14.16.24.png
          2014-08-04_14.16.24.png
          226 kB
        6. 2014-08-04_14.16.29.png
          2014-08-04_14.16.29.png
          251 kB

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                thebombzen Leo Izen
              • Votes:
                5 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: