Persistent Attributes

  • Attributes are indeed only valid during the session. Right now it's more meant to be a convenient way to store temporary per-instance data (and possibly share it between plugins)... in fact it wouldn't be easy to make them persistent - right now it's possible to store any object as attribute (this could be a reference to another class, e.g a UI element, or just a primitive data type), but we could only store primitive data types persistently (no way to store and recover that properly).


    We could think about adding a way to store separate, persistent attributes, but that would be limited to serializable data only (e.g. primitive data types, strings, vectors etc). Custom objects could only be stored if they implement the serializable interface (but no way to store API objects, like players, UI elements etc). It would be a separate API then, like setPersistentAttribute(), getPersistentAttribute() etc.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!