dev.plexusmodloader.api.content.attribute
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
AttributeDefinition | record | A mod attribute: a number every entity in scope carries, which modifiers raise or lower, like the game's minecraft:max_health or minecraft:luck. |
AttributeHandle | interface | A declared mod attribute; pass id() to LivingEntityView.attribute and its relatives. |
AttributeOperation | enum | How an attribute modifier changes the value. |
AttributeScope | enum | Which entities carry a mod attribute. |
AttributeDefinition
record · Stability PREVIEW · Since next release
public record AttributeDefinition(double defaultValue, double minValue, double maxValue, boolean syncedToClients, AttributeScope scope)
A mod attribute: a number every entity in scope carries, which modifiers raise or lower, like the game's minecraft:max_health or minecraft:luck. Its name comes from attribute.name.<mod id>.<path>. Read and change it with LivingEntityView.attribute, setAttributeBase and addAttributeModifier, or with the game's /attribute command.
The game keeps the value inside [minValue, maxValue] after modifiers. Entities save their base value and permanent modifiers with the world.
| Component | Type | Description |
|---|---|---|
defaultValue | double | base value of an entity that never changed it |
minValue | double | lowest value |
maxValue | double | highest value |
syncedToClients | boolean | whether clients learn the value of the entities they see (needed only when client code reads it) |
scope | AttributeScope | which entities carry it |
AttributeDefinition(double, double, double, boolean, AttributeScope)
public AttributeDefinition(double defaultValue, double minValue, double maxValue, boolean syncedToClients, AttributeScope scope)
Since next release
| Parameter | Type | Description |
|---|---|---|
defaultValue | double | — |
minValue | double | — |
maxValue | double | — |
syncedToClients | boolean | — |
scope | AttributeScope | — |
Throws IllegalArgumentException — when a value is not finite, minValue > maxValue, or the default is outside the range
of(double, double, double)
public static AttributeDefinition of(double defaultValue, double minValue, double maxValue)
Since next release
An attribute every living entity carries, not synchronised to clients.
| Parameter | Type | Description |
|---|---|---|
defaultValue | double | — |
minValue | double | — |
maxValue | double | — |
Returns AttributeDefinition
withClientSync()
public AttributeDefinition withClientSync()
Since next release
The same definition, synchronised to clients.
Returns AttributeDefinition
withScope(AttributeScope)
public AttributeDefinition withScope(AttributeScope newScope)
Since next release
The same definition, carried only by newScope.
| Parameter | Type | Description |
|---|---|---|
newScope | AttributeScope | — |
Returns AttributeDefinition
AttributeHandle
interface · Stability PREVIEW · Since next release
public interface AttributeHandle extends ContentHandle
A declared mod attribute; pass id() to LivingEntityView.attribute and its relatives.
Supertypes: ContentHandle
AttributeOperation
enum · Stability PREVIEW · Since next release
public enum AttributeOperation
How an attribute modifier changes the value. The game applies every ADD_VALUE to the base first, then ADD_MULTIPLIED_BASE, then ADD_MULTIPLIED_TOTAL, and keeps the result inside the attribute's range.
| Constant | Description |
|---|---|
ADD_VALUE | Adds the amount to the base. |
ADD_MULTIPLIED_BASE | Adds base * amount, using the base after every ADD_VALUE. |
ADD_MULTIPLIED_TOTAL | Multiplies the running value by 1 + amount. |
AttributeScope
enum · Stability PREVIEW · Since next release
public enum AttributeScope
Which entities carry a mod attribute.
| Constant | Description |
|---|---|
PLAYERS | Players only. |
LIVING_ENTITIES | Every living entity: players, the game's mobs, armour stands, and mod mobs. |