#I want to track item frame entities
1 messages · Page 1 of 1 (latest)
And other question do the objects of still valid Entities may not be synced anymore with the actual entity. (and instead the entity creates a new entity object)
Yes entities get new objects every time they are loaded again.
Listen to the PlayerInteractEvent
For changes
And use a Set instead of a List
so in my case Im doing it alright because I remove them from my cache when EntitiesUnloadEvent right? I mean with what i'm doing i'm sure the entities that are in my cache are either removed/killed (.isValid()=False) OR bound & synced to an entity, righ?
what if another plugin changes the content of itemframe?
alr thank you
There is no good way to detect that. You could implement your own nms class that does.
Or check once every 5 seconds
oh interesting, what would it roughly look like?
Not a class that check once every 5 seconds or sth like that?
Oh do you mean making a new implementation of the entity class?
Yes a runnable that is scheduled
why nms then
can i have more info about the nms impl, what does it consist in?
Overriding the default CraftBukkit impl of Entity, adding trackers in methods like .setContent() (or whatever the name of the method) before calling super().setContents(..)
also do u think its overkill?
Not the CraftBukkit implementation. The actual nms implementation. And then override the registry so your custom class is used instead of the vanilla class. Then you can add events to the methods.
hm interesting, i'll think about it, do u have some template somewhere of sth similar
Also one last thing:
NMS & CraftBukkit are 2 seperate implementations?
Anyway, thank you very much smiling dude!