mojira.dev
MC-204708

Using /execute store result into an Attribute Modifier's Amount doesn't work

It just doesn't set the value even if the command doesn't fail.

To reproduce:

  1. Summon a creeper near you /summon creeper ~ ~ ~ {NoAI:1}

  2. Add the modifier to the creeper: /data modify entity @e[type=creeper,limit=1,sort=nearest] Attributes[ {Name:"minecraft:generic.max_health"}].Modifiers append value
    {Name:"test.max_health",Amount:0.0,Operation:1,UUID:[I;-633757882,1012614665,-1758719176,-1591490096]}

  3. Check that the modifier is there: /data get entity @e[type=creeper,limit=1,sort=nearest] Attributes[ {Name:"minecraft:generic.max_health"}].Modifiers ... it's there

  4. Add a dummy scoreboard objective /scoreboard objectives add test dummy

  5. Set a score value for the creeper {color:#0747a6}/scoreboard players set @e[type=creeper,limit=1,sort=nearest] test 16{color}

  6. And now the offender: /execute as @e[type=creeper,limit=1,sort=nearest] store result entity @s Attributes[ {Name:"minecraft:generic.max_health"}].Modifiers[
    {Name:"hg.max_health"}].Amount double 1 run scoreboard players get @s test ... The command outputs entity_uuid has 16 [test] but the Amount is not set:

  7. /data get entity @e[type=creeper,limit=1,sort=nearest] Attributes[ {Name:"minecraft:generic.max_health"}].Modifiers

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-192981, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

insane96mcp

(Unassigned)

Unconfirmed

(Unassigned)

1.16.4

Retrieved