For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityExhaustionComponent.md.

Class: EntityExhaustionComponent

entity component

Beta

定义与此实体的 exhaustion(疲劳度)交互方式。封装了 minecraft:player.exhaustion 属性。

Defines the interactions with this entity for Exhaustion. Wraps the minecraft.player.exhaustion attribute.

Extends

Properties

currentValue

readonly currentValue: number

Beta

Remarks

此实例当前属性的值。

Current value of this attribute for this instance.

Throws

This property can throw when used.

Inherited from

EntityAttributeComponent.currentValue


defaultValue

readonly defaultValue: number

Beta

Remarks

返回此属性的默认定义值。

Returns the default defined value for this attribute.

Throws

This property can throw when used.

Inherited from

EntityAttributeComponent.defaultValue


effectiveMax

readonly effectiveMax: number

Beta

Remarks

返回给定任何其他环境组件或因素后此属性的有效最大值。

Returns the effective max of this attribute given any other ambient components or factors.

Throws

This property can throw when used.

Inherited from

EntityAttributeComponent.effectiveMax


effectiveMin

readonly effectiveMin: number

Beta

Remarks

返回给定任何其他环境组件或因素后此属性的有效最小值。

Returns the effective min of this attribute given any other ambient components or factors.

Throws

This property can throw when used.

Inherited from

EntityAttributeComponent.effectiveMin


entity

readonly entity: Entity

Beta

Remarks

拥有此组件的实体。如果实体已被移除,则实体将为 undefined

The entity that owns this component. The entity will be undefined if it has been removed.

Throws

This property can throw when used.

InvalidEntityError

Inherited from

EntityAttributeComponent.entity


isValid

readonly isValid: boolean

Beta

Remarks

返回该组件是否有效。如果组件的拥有者有效,并且满足组件所需的任何额外验证,则该组件被视为有效。

Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

Inherited from

EntityAttributeComponent.isValid


typeId

readonly typeId: string

Beta

Remarks

组件的标识符。

Identifier of the component.

Inherited from

EntityAttributeComponent.typeId


componentId

readonly static componentId: "minecraft:player.exhaustion" = 'minecraft:player.exhaustion'

Beta

Methods

resetToDefaultValue()

resetToDefaultValue(): void

World Mutation Beta

Returns

void

Remarks

将此属性的当前值重置为定义的默认值。

Resets the current value of this attribute to the defined default value.

Throws

This function can throw errors.

Inherited from

EntityAttributeComponent.resetToDefaultValue


resetToMaxValue()

resetToMaxValue(): void

World Mutation Beta

Returns

void

Remarks

将此属性的当前值重置为定义的最大值。

Resets the current value of this attribute to the maximum defined value.

Throws

This function can throw errors.

Inherited from

EntityAttributeComponent.resetToMaxValue


resetToMinValue()

resetToMinValue(): void

World Mutation Beta

Returns

void

Remarks

将此属性的当前值重置为定义的最小值。

Resets the current value of this attribute to the minimum defined value.

Throws

This function can throw errors.

Inherited from

EntityAttributeComponent.resetToMinValue


setCurrentValue()

setCurrentValue(value): boolean

World Mutation Beta

Parameters

value

number

Returns

boolean

Remarks

设置此属性的当前值。

Sets the current value of this attribute.

Throws

如果值超出范围,将抛出 ArgumentOutOfBounds Error。

If the value is out of bounds, an ArgumentOutOfBounds Error is thrown.

ArgumentOutOfBoundsError

InvalidEntityError

Inherited from

EntityAttributeComponent.setCurrentValue

同领域相关