Mojira Archive
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 /scoreboard players set @e[type=creeper,limit=1,sort=nearest] test 16
  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

Duplicate

Insane96MCP

2020-11-08, 09:56 AM

2021-01-04, 10:12 AM

2021-01-04, 10:07 AM

0

0

Unconfirmed

(Unassigned)

1.16.4

-