mojira.dev
MC-299801

/attribute @s minecraft:(attribute) get is inaccurate

when using a custom item for example

/give @p netherite_chestplate[attribute_modifiers=[{id:"armor",type:"armor",amount:100,operation:"add_value",slot:"chest",display:{type:"default"}},{id:"armor_toughness",type:"armor_toughness",amount:100,operation:"add_value",slot:"chest",display:{type:"default"}}]] 1

and the following cmds give these results

"/attribute @s minecraft:armor get" caps out at 30.0

"/attribute @s minecraft:armor_toughness get" caps out at 20.0

ideally they should show 100 for both

why is this weird? 🧐

when trying the same thing with these cmds the results change:

“/attribute @s minecraft:armor modifier value get minecraft:armor“ gives the correct result 100

“/attribute @s minecraft:armor_toughness modifier value get minecraft:armor_toughness“ gives the correct result 100

if this is intentional i would like to hear why 😁

Environment

java
commands
command blocks
datapacks

Attachments

Comments 2

Please edit your report to change the Affected Version to the version shown on the Minecraft title screen

Not a bug. The armor attribute is limited to the value range 0 through 30, and armor_thoughness to 0 through 20. Even if individual modifiers try to apply a value outside those respective ranges, the actual resulting attribute value will always be capped.

mika

(Unassigned)

Unconfirmed

(Unassigned)

1.21.7, 1.21.8 Release Candidate 1

Retrieved