Minecraft:Commands/attribute: Difference between revisions
From SAS Gaming Wiki
More actions
→Examples: added another example |
Sync: updated from Minecraft |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 68: | Line 68: | ||
*: To set the minimum scale value of the current entity to .5: | *: To set the minimum scale value of the current entity to .5: | ||
*:: <code>/attribute @s minecraft:armor base set .5</code> | *:: <code>/attribute @s minecraft:armor base set .5</code> | ||
*: | * To set the follow range of the nearest mob to 5: | ||
*:<code>/attribute @n[type=!player] minecraft:follow_range base set 5</code> | |||
== History == | == History == | ||
| Line 86: | Line 87: | ||
[[Minecraft:de:Befehl/attribute]] | [[Minecraft:de:Befehl/attribute]] | ||
[[Minecraft:es:Comandos/attribute]] | [[Minecraft:es:Comandos/attribute]] | ||
[[Minecraft:fr:Commandes/attribute]] | |||
[[Minecraft:ja:コマンド/attribute]] | [[Minecraft:ja:コマンド/attribute]] | ||
[[Minecraft:pt:Comandos/attribute]] | [[Minecraft:pt:Comandos/attribute]] | ||
[[Minecraft:zh:命令/attribute]] | [[Minecraft:zh:命令/attribute]] | ||
Latest revision as of 11:05, 15 August 2026
Template:Exclusive Template:Infobox command
Used to change or read Minecraft:attributes.
Syntax
attribute <target> <attribute> get [<scale>]- Returns the total value of the specified attribute.
attribute <target> <attribute> base get [<scale>]- Returns the base value of the specified attribute.
attribute <target> <attribute> base set <value>- Overwrites the base value of the specified attribute with the given value.
attribute <target> <attribute> base reset- Resets the base value of the specified attribute to its default value.
attribute <target> <attribute> modifier add <id> <value> (add_value|add_multiplied_base|add_multiplied_total)- Adds an attribute modifier with the specified properties if no modifier with the same ID already existed.
attribute <target> <attribute> modifier remove <id>- Removes the attribute modifier with the specified ID.
attribute <target> <attribute> modifier value get <id> [<scale>]- Returns the value of the modifier with the specified ID.
Arguments
- The Minecraft:entity that the Minecraft:attribute is applied to. Only Minecraft:players, Minecraft:armor stands, and Minecraft:mobs have attributes.
- Template:Arg desc
- Specifies the attribute.
- Template:Arg desc
- The number the value is multiplied with before being stored with Template:Cmd command.
- Template:Arg desc
- Specifies the id of a modifier.
- Template:Arg desc
- Specifies the value to use.
- Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Examples
- To set the minimum armor value of the current entity to 5:
/attribute @s minecraft:armor base set 5- To set the minimum scale value of the current entity to .5:
/attribute @s minecraft:armor base set .5
- To set the follow range of the nearest mob to 5:
/attribute @n[type=!player] minecraft:follow_range base set 5
History
Minecraft:de:Befehl/attribute Minecraft:es:Comandos/attribute Minecraft:fr:Commandes/attribute Minecraft:ja:コマンド/attribute Minecraft:pt:Comandos/attribute Minecraft:zh:命令/attribute