Give a mod (or command block) the ability to attach key/value data to a player character behind the scenes. This should accept a few basic data types, such as double, int, string.
- Persisted when the player logs off
- Read/Write based on a shared hash structure
- Does not allow for arbitrary objects, only a few data types
- Keys are always strings
Justification / Use Case:
Can be used collectively by mods to track character state. Examples would be thirst level in DayZ mod or team in the TF2 map. If this data is available to command blocks, queries can be performed or state set.
Other mods could add displays of these states (when desired) to the HUD.
This would allow for a clear communication channel between mods about player state, while providing an included method for serializing the data to disk.
A suitable concurrent hash will need to be used depending on how mods/command blocks will interact. (See java.util.ConcurrentHashMap)
Resetting/managing a players meta data may be required if the data is persisted to recover from broken states
Mod authors will need to coordinate the meaning of certain keys.
This could be broadly applied to any entity, but players are the primary entity that persists.