#(aviside) Making the "Flagged" switch usable in any non-player entity event
18 messages · Page 1 of 1 (latest)
(aviside) Making the "Flagged" switch usable in any non-player entity event
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.
Most events have an entity matcher for any checks to do with relevant entities, what are you trying to do?
Yeah, I can accomplish anything without this switch so far, I just thought this feature could simplify writing events for mobs and (possibly) improve performance.
Here's what got me to write the post:
I wanted to flag a zombie that targeted a player and then track the flagged zombie using "zombie flagged:<myflag> steps on block".
I know that's easily accomplishable by checking their flag. Idk how the flagged switch works on the backend, but I also thought it could improve performance if I'm only checking for the flagged entity. Especially if I have extra data I want to compare after the initial if statement
So Instead of periodically checking every zombie for a flag I could more frequently check the flagged entity without as many performance concerns. Again, I don't know how the flagged switch works on the backend and if it's already checking every player and not just the one that has the flag. Hopefully I didn't overcomplicate that lol
I think what you're looking for here might be entity_flagged:<flag>. There are a fair number of entity matchers available.
!objecttype entitytag
An EntityTag represents a spawned entity, or a generic entity type.
Note that players and NPCs are valid EntityTags, but are generally represented by the more specific
PlayerTag and NPCTag objects.
Note that a spawned entity can be a living entity (a player, NPC, or mob) or a nonliving entity (a painting, item frame, etc).
This object type is flaggable.
Flags on this object type will be stored in the world chunk files as a part of the entity's NBT.
e
ElementTag
FlaggableObject, PropertyHolderObject
The identity format for entities is a spawned entity's UUID, or an entity type.
For example, 'e@abc123' or 'e@zombie'.
As far as performance goes I'll leave that for others, however I haven't seen anything weird with performance unless I'm doing something weird, like unintentionally loading all of the End world... But that wouldn't be Denizen related.
ahh I didn't know entity_flagged existed, thank you vm
^ ye that's what I was going for - since every queue has a linked player, global stuff like flagged: can be implemented, but entities are specific to different events, so should just use the event's built-in entity matchers, such as that one ^
Thread is now a Help/Support thread. A helper will check your thread when available.
Feel free to ask if you need any more help, otherwise -
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@grave thistle