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

/damage isn't compatible with /execute store result

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • 23w06a
    • OS: Windows 10
      Java: 17.0.3 64bit
    • Confirmed
    • (Unassigned)

      "/execute store result score @s .objective run damage @s 5" only returns a true/false value of if the command is successful or not, like "/execute store success" should and does, rather than what I would expect: returning the value of damage dealt.

      For example: storing the result of dealing 5 damage to a player with 20 health will return a value of 1, and returns a value of 0 if the player is invulnerable at that time. This is the behavior I would expect out of "execute store success" exclusively.

      What I expected to happen from storing the result of dealing 5 damage to a player with 20 health was returning a value of 5, and storing the result of dealing 5 damage to a player with 3 health returning 3, since that's how much health there was that was damaged.

       

      Steps to reproduce:

      • Create a scoreboard objective: "/scoreboard objectives add .objective dummy"
      • Display the objective to the sidebar: "/scoreboard objectives setdisplay sidebar .objective"
      • While in survival mode, store the result of damaging yourself to the objective: "/execute store result score @s .objective run damage @s 5"
      • Notice the output is "1" rather than the expected "5"

            Unassigned Unassigned
            PvPqnda PvP Panda
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: