본문으로 건너뛰기

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.

구성 요소타입설명
defaultValuedoublebase value of an entity that never changed it
minValuedoublelowest value
maxValuedoublehighest value
syncedToClientsbooleanwhether clients learn the value of the entities they see (needed only when client code reads it)
scopeAttributeScopewhich entities carry it

AttributeDefinition(double, double, double, boolean, AttributeScope)​

public AttributeDefinition(double defaultValue, double minValue, double maxValue, boolean syncedToClients, AttributeScope scope)

추가된 버전 다음 릴리스

인자타입설명
defaultValuedouble—
minValuedouble—
maxValuedouble—
syncedToClientsboolean—
scopeAttributeScope—

예외 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.

인자타입설명
defaultValuedouble—
minValuedouble—
maxValuedouble—

반환 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.

인자타입설명
newScopeAttributeScope—

반환 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_VALUEAdds the amount to the base.
ADD_MULTIPLIED_BASEAdds base * amount, using the base after every ADD_VALUE.
ADD_MULTIPLIED_TOTALMultiplies the running value by 1 + amount.

AttributeScope​

열거형 · 안정성 PREVIEW · 추가된 버전 다음 릴리스

public enum AttributeScope

Which entities carry a mod attribute.

상수설명
PLAYERSPlayers only.
LIVING_ENTITIESEvery living entity: players, the game's mobs, armour stands, and mod mobs.
커피 한 잔 후원하기