Package noppes.npcs.api.handler
Interface IAttributeHandler
-
public interface IAttributeHandlerHandles registration and lookup of attribute definitions as well as retrieval of player attributes.Maintain a unique registry of attribute definitions and provide methods to retrieve a player's aggregated attributes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IAttributeDefinition[]getAllAttributesArray()Returns an array of all registered attribute definitions.IAttributeDefinitiongetAttributeDefinition(java.lang.String key)Returns the attribute definition corresponding to the given key.IPlayerAttributesgetPlayerAttributes(IPlayer player)Returns the aggregated attributes for a given player.
-
-
-
Method Detail
-
getPlayerAttributes
IPlayerAttributes getPlayerAttributes(IPlayer player)
Returns the aggregated attributes for a given player.- Parameters:
player- the player whose attributes are requested- Returns:
- an
IPlayerAttributesinstance containing all custom attributes for the player, or null if the player is invalid
-
getAttributeDefinition
IAttributeDefinition getAttributeDefinition(java.lang.String key)
Returns the attribute definition corresponding to the given key.- Parameters:
key- the unique key identifying the attribute (e.g., "health", "movement_speed")- Returns:
- the
IAttributeDefinitioninstance for the specified key, or null if not found
-
getAllAttributesArray
IAttributeDefinition[] getAllAttributesArray()
Returns an array of all registered attribute definitions.- Returns:
- an array of
IAttributeDefinitionobjects representing all attributes
-
-