mojira.dev
MC-267582

Scaled "/attribute modifier value get" output is misleading

The bug

The output of /attribute <entity> <attribute> modifier value get always outputs the unscaled value of the modifier, and makes no mention of the scale parameter, even if provided.
If run inside an /execute store, the stored value is properly scaled.

This is in contrast to /data get, where the command outputs the scale parameter (if supplied) and the scaled value.

Expected result

The command would mention the scale parameter and scaled modifier value, like /data get.

Steps to reproduce

  1. Create a dummy modifier

    /attribute @s minecraft:generic.luck modifier add 01234567-89ab-cdef-0123-456789abcdef "Dummy modifier" 1 add
  2. Create an example objective and make it visible

    /scoreboard objectives add example dummy "Example"
    /scoreboard objectives setdisplay sidebar example
  3. Retrieve the modifier value, scale it by 5 and store it in the example objective

    /execute store result score @s example run attribute @s generic.luck modifier value get 01234567-89ab-cdef-0123-456789abcdef 5
    • Observe the unexpected output:

      Value of modifier 01234567-89ab-cdef-0123-456789abcdef on attribute Luck for entity [...] is 1.0
    • Meanwhile, the player's score has the correct value of 5.

  4. Repeat the above, but via /data get, and scale by 10.

    /execute store result score @s example run data get entity @s Attributes[{Name:"minecraft:generic.luck"}].Modifiers[0].Amount 10
    • Observe the correct output:

      Attributes[{Name:"minecraft:generic.luck"}].Modifiers[0].Amount on [...] after scale factor of 10.00 is 10
    • Meanwhile, the player's score is updated to 10, as expected.

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-226898, 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 (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

SnipUndercover

(Unassigned)

Unconfirmed

Commands

23w51b

Retrieved