Attribute

interface Attribute

Represents an attribute that can be applied to a living entity.

Functions

Link copied to clipboard
abstract fun addModifier(modifier: AttributeModifier)

Adds the given modifier to the list of modifiers.

Link copied to clipboard
abstract fun calculateValue(): Double

Calculates the final value of this attribute by applying the modifiers to the base value.

Link copied to clipboard
abstract fun clearModifiers()

Clears all modifiers for this attribute.

Link copied to clipboard
abstract fun getModifier(uuid: UUID): AttributeModifier?

Gets the modifier with the given uuid, or returns null if there is no modifier with the given uuid.

Link copied to clipboard

Gets all modifiers stored under the given operation.

Link copied to clipboard
abstract fun removeModifier(modifier: AttributeModifier)

Removes the given modifier from the list of modifiers.

Properties

Link copied to clipboard
abstract var baseValue: Double

The base value of this attribute.

Link copied to clipboard

The modifiers used to modify the baseValue in calculation to get the value.

Link copied to clipboard
abstract val type: AttributeType

The type of this attribute.