I am currently creating a new Plugin that includes mount protection, because we had some griefers in the past days and i dont like searching for my horse every time and also i dont want to jail my animals to protect them, and also i dont want to prevent everyone from entering my property. So my current solution is saving a player ref in the npc name and it works well but i would like to have some persistent attributes i can add to npcs to make this somehow more elegant.
In the api reference i found nothing else i could use.
NPC persistent attributes @red
-
- English
- Devidian
- Thread is Unresolved
-
-
There was actually a discussion about persistent attributes before: Persistent Attributes
Basically it's possible to implement this, but with some limitations unfortunately. The main limitation is that you wouldn't be able to store any type of object, instead it would be limited to serializable data (e.g. primitive data types, strings etc)... I will take a closer look at this

-
Sure, in most cases its enough to save references e.g. player.getDbID(). I didnt see that Discussion before, sorry. I could also create a meta plugin that uses the npc id and adds key/value attributes but then every other plugin would need to use this plugin to get any data.
I just looked up the npc database with my vscode sqlite viewer plugin.
I see owner already exists as column, for my current issue it would be enought to have getter and setter for this. That might be easier to implement for the next update. I mean i could also use WorldDatabase and execute my own sql on it but i dont like to manipulate vanilla dbs from plugins.
btw. is there a way to change any existing radial menu? For example when i want to add something like "rename mount" so i dont need to set editnpc true. Or to stay in the current case "claim mount" and "release mount".
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!