Package noppes.npcs.api.handler.data
Interface IPlayerAttributes
-
public interface IPlayerAttributesRepresents a collection of a player's custom attributes.Expose methods to retrieve all attribute instances as an array, look up individual attributes by key, and check for the presence of a specific attribute.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ICustomAttributegetAttribute(java.lang.String key)Returns the custom attribute instance identified by the given key.ICustomAttribute[]getAttributes()Returns an array of all custom attribute instances associated with the player.floatgetAttributeValue(java.lang.String key)Returns the value of the attribute identified by the given key.booleanhasAttribute(java.lang.String key)Checks whether an attribute with the given key exists.voidrecalculate(IPlayer player)Recalulates Item Attributes on a Player
-
-
-
Method Detail
-
recalculate
void recalculate(IPlayer player)
Recalulates Item Attributes on a Player
-
getAttributes
ICustomAttribute[] getAttributes()
Returns an array of all custom attribute instances associated with the player.- Returns:
- an array of
ICustomAttributeobjects
-
getAttributeValue
float getAttributeValue(java.lang.String key)
Returns the value of the attribute identified by the given key.- Parameters:
key- the attribute key (e.g., "health", "movement_speed")- Returns:
- the float value of the attribute, or 0 if the attribute is not found
-
hasAttribute
boolean hasAttribute(java.lang.String key)
Checks whether an attribute with the given key exists.- Parameters:
key- the attribute key to check- Returns:
- true if the attribute exists, false otherwise
-
getAttribute
ICustomAttribute getAttribute(java.lang.String key)
Returns the custom attribute instance identified by the given key.- Parameters:
key- the attribute key (e.g., "health", "movement_speed")- Returns:
- the corresponding
ICustomAttributeinstance, or null if not found
-
-