Uploaded image for project: 'Minecraft API'
  1. Minecraft API
  2. MCAPI-66

Meta data on players - allowing mods to share state on a player

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Labels:

      Description

      Proposed Addition:

      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.

      Specific Features:

      • 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.

      Challenges Faced:
      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.

      Additional thoughts:
      This could be broadly applied to any entity, but players are the primary entity that persists.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              scott.markwell Scott Markwell
            • Votes:
              4 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: