So i have a configuration file where you can set item's lore like this: Code: lore-overrides: - id: 1 lore: "Hello world" - id: 2 lore: "this is test lore message" And a command that writes lore to item using ItemMeta and sets "custom_lore_id" nbt tag. Now, how do i globally update item's lore when configuration values change? Every item that has custom lore has "custom_lore_id": <number> NBT. There is a HashMap<Integer, String> of these ids mapped to lore messages. I've thought about modifying outgoing packets and setting item's lore there instead of using ItemMeta, but not sure on how do i modify packets. I have also thought about overriding CraftMetaItem#getLore method but CraftMetaItem is private class and i cannot override it. So i would like to know: is it really possible & worth it to modify packets? are package-private classes really not override'able? maybe other hints on how do i implement this?
Currently its reloaded maybe about 1-2 times a day, but one of the planned features of the plugin might cause configuration to update up to 20 times a minute.
You might want to reconsider that amount, or the place where you are storing the lores. Loop through the inventories of the players, find the item, replace the lore. Do this with a runTaskTimer For inventories: replace when players open them.