dev.plexusmodloader.api.content.attribute
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
AttributeDefinition | 레코드 | 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 | 인터페이스 | A declared mod attribute; pass id() to LivingEntityView.attribute and its relatives. |
AttributeOperation | 열거형 | How an attribute modifier changes the value. |
AttributeScope | 열거형 | Which entities carry a mod attribute. |
AttributeDefinition
레코드 · 안정성 PREVIEW · 추가된 버전 다음 릴리스
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.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
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)
추가된 버전 다음 릴리스
| 인자 | 타입 | 설명 |
|---|---|---|
defaultValue | double | — |
minValue | double | — |
maxValue | double | — |
syncedToClients | boolean | — |
scope | AttributeScope | — |
예외 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)
추가된 버전 다음 릴리스
An attribute every living entity carries, not synchronised to clients.
| 인자 | 타입 | 설명 |
|---|---|---|
defaultValue | double | — |
minValue | double | — |
maxValue | double | — |
반환 AttributeDefinition
withClientSync()
public AttributeDefinition withClientSync()
추가된 버전 다음 릴리스
The same definition, synchronised to clients.
반환 AttributeDefinition
withScope(AttributeScope)
public AttributeDefinition withScope(AttributeScope newScope)
추가된 버전 다음 릴리스
The same definition, carried only by newScope.
| 인자 | 타입 | 설명 |
|---|---|---|
newScope | AttributeScope | — |
반환 AttributeDefinition
AttributeHandle
인터페이스 · 안정성 PREVIEW · 추가된 버전 다음 릴리스
public interface AttributeHandle extends ContentHandle
A declared mod attribute; pass id() to LivingEntityView.attribute and its relatives.
상위 형식: ContentHandle
AttributeOperation
열거형 · 안정성 PREVIEW · 추가된 버전 다음 릴리스
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.
| 상수 | 설명 |
|---|---|
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
열거형 · 안정성 PREVIEW · 추가된 버전 다음 릴리스
public enum AttributeScope
Which entities carry a mod attribute.
| 상수 | 설명 |
|---|---|
PLAYERS | Players only. |
LIVING_ENTITIES | Every living entity: players, the game's mobs, armour stands, and mod mobs. |