mojira.dev
MC-259830

/damage isn't compatible with /execute store result

"/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"

Attachments

Comments 3

This is a feature request.

'/execute store result score @s objective run scoreboard players set @s otherObjective 5'
works like the bug reporter means:

=> objective = 5
=> otherObjective = 5

Should I add this as feedback on the feedback site, or has this already been accounted for in that regard?

PvPqnda

(Unassigned)

Confirmed

(Unassigned)

commands, execute, result, store

23w06a

Retrieved