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

Attack cooldown reset after the "use" function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.17
    • None
    • Unconfirmed
    • (Unassigned)

      When the player performs a "use" function while their main hand is holding a weapon, and then attacks immediately, they perform a weak attack instead of a fully charged attack. It seems that the attack cooldown counter is reset when the player performs the "use" function, but this is not reflected in the attack indicator or the main hand animation.

      How to confirm:
      1. Summon a mob with a known value of health.
      2. Hold a weapon (e.g. an axe) in the main hand, and a block in the off hand. Alternatively, can only hold the weapon, but prepare a block in the background where the player can perform a "use" function without opening a GUI (note block, fence gate, etc.)
      3. Make sure the attack indicator is enabled.
      4. Perform the "use" function, either by placing the block in the off hand, or tuning the note block; then immediately perform an attack on the mob. Then, use /data get entity <UUID> Health to confirm the damage dealt by the attack.
      5. The damage dealt to the mob should be less than the full attack damage, indicating that the attack cooldown has been reset by the "use" function. However, the attack indicator does not show this cooldown reset, nor does the main hand animation (i.e. axe raising).

      Image description
      1. A creeper (20 health) is used as the target. An iron axe attack is performed on the creeper immediately after a stone block in the off hand is placed. As shown in the command block output, the creeper has only received a damage of 1.98 health points, instead of the usual 9.
      2. Shows the stone block in the off hand being placed, reflected by the off hand animation. According to the above tests, the attack cooldown should be reset after this "use" function, but the attack indicator (crosshair) does not reflect this.

      Solutions
      Either of these three solutions can be applied.
      1) Remove the attack cooldown reset after the "use" function. The attack cooldown is only supposed to reset after an "attack" function, or when switching hotbar slots. It does not make sense if the attack cooldown is reset after a "use" function, which is independent with the "attack" function.
      2) Stick to the current resetting scheme, but show the attack cooldown reset via the attack indicator. It can be confusing if the player cannot perform a full-strength attack if their attack indicator says they can, just because they have just performed a "use" function.
      3) Make it so that only some "use" functions would reset the attack cooldown. If the "use" function is performed with the off hand (placing a block, using flint and steel, etc.), then the attack cooldown should not be reset, as the main hand is not used. If the main hand performs the "use" function (stripping logs with axe, opening a door, etc.), then the attack indicator should be reset. The attack indicator should still accurately represent whether the cooldown is reset or not.

        1. 2021-06-17_21.45.26.png
          166 kB
          windwend
        2. 2021-06-17_21.46.36.png
          415 kB
          windwend
        3. 2021-06-18 15-00-07.mkv
          2.76 MB
          Brevort

            Unassigned Unassigned
            windwend windwend
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: