Class EntityHealthComponent

Defines the health properties of an entity.

Hierarchy

Constructors

Properties

current: number

Read-only. Returns the current value of health for the entity.

Throws

This property can throw when used.

typeId: string

Identifier of this component. Should always be minecraft:health.

value: number

Value for health as defined through entity components.

Throws

This property can throw when used.

componentId: "minecraft:health" = 'minecraft:health'

Identifier of this component. Should always be minecraft:health.

Methods

  • Returns void

    Remarks

    Resets the current health value of the entity to its default value.

    Throws

    This function can throw errors.

  • Returns void

    Remarks

    Resets the current health of the entity to its maximum value.

    Throws

    This function can throw errors.

  • Returns void

    Remarks

    Resets the current health to the minimum value.

    Throws

    This function can throw errors.

  • Parameters

    • value: number

    Returns void

    Remarks

    Sets the current health of the entity.

    Throws

    This function can throw errors.