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

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

XMLWordPrintable

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

      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

            Unassigned Unassigned
            insane96mcp Insane96MCP
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: