This feature is unique to the Java version.Attribute
The authority level required | 2 | Limited conditions None | |
---|
Used to change or read attributes.
Grammar Attribute
Attribute
Attribute
Attribute
Attribute
Specific usage Attribute
... get [
Return the total value of the specified attribute. ... base get [
Back to the base value of the specified attribute. ... Base Set
Use a given value to cover the base value of the specified attribute. ... Modifier (add | Remove | Value Get)
... Add
If there is no modifier with the same UUID, add an attribute modifier with a specified attribute. ... Remove
Delete an attribute modifier with a specified UUID. ... Value Get
Returns the value of a modifier with a specified UUID.parameter
: Entity
Application attribute entity.Only players, biology and armor have attributes.It must be the player's name, target selector or UUID.And the target selector allows only one entity.
: resource_location
Specify the naming space ID of the attribute.Must be named space ID.
: double
Used for the /Execute Store Result
command, and the number of values obtained and the value is used as the return value (the decimal will be tidy down).It must be a dual -precision floating point number.
: UUID specifies the UUID of the modifier in the string format.The modifier with the same UUID is not stacked.Sixteen -in -made UUIDs with characters must be used.Accept the following characters:
-
a
- f
a
- f
0
- 9
Essence
: string
Specify the name of the property modifier.It must be a string.And it must be a quotation word group (a single word or a string included in quotes, and the allowed characters include: +
, -
CODE> _ , A
- Z
, A
- Z
and 0
- 9
).
: double
Specify the value of use.It must be a dual -precision floating point number.result
Command | triggering conditions | java version | TR>
---|---|---|
Any | Incorrect parameters | Analysis |
It cannot be parsed as a single player, armor frame, creature (designated players must be online) | Execution failure | |
... modifier addd... | The attribute does not exist (for example, the player does not have Minecraft: horse.jump_stringh ) | ... Modifier add ... | The modifier already exists |
... Modifier Remove ... Modifier Value Get ... | The modification symbol does not exist | Any | When the execution is successful, | Change or return the attribute value. |
Command | Successful successNumber | /Execute Store Success ... | /execute Store Result ... | |
---|---|---|---|---|
Any | java version | The execution failure | 00 | 0 |
... get [ | Successful execution | 1 | Specify the value of the specified attribute), the decimal will be tidy down.) | |
... Base Get [ | Execution of executionSuccess | 1 | 1 | The base value of the specified attribute (by ), the decimal will be taken down and tidy down.Essence) |
... Modifier value get | Successful execution | 1 | 1 | The value of the specified attribute modifier (multiplied by ), decimalWill be taken down.) |
... base set ...... modifier add ...... modifier remove... | Successful execution | 1
/Attribute @S Minecraft: Generic.armor Base Set 5
Set the maximum health of all players to 2 (classic extreme survival):
/Execute as @a Run Attribute @S Minecraft: Generic.Max_health Base Set 2