WildLoaders icon indicating copy to clipboard operation
WildLoaders copied to clipboard

Add a metadata to fake players so external plugins can detect them

Open SkytAsul opened this issue 1 year ago • 9 comments

Minecraft's Version

1.20.4

Plugin's Version

2023.3

Describe the bug

Not a bug, but you told me to open an issue and that's the only template I am allowed to choose. Anyway, it's related to this discussion: https://github.com/BG-Software-LLC/WildLoaders/discussions/81 Bukkit#getPlayers maybe does not return your NPCs, but some player events are still fired with the NPCs. The "NPC" metadata is quite common (Citizens does it, for instance) so that would be nice to add, and it does not have any drawback afaik.

To Reproduce

nothing

Additional Information

No response

SkytAsul avatar Feb 10 '24 13:02 SkytAsul

Which events are fired? I want to get rid of them, and I will also add the metadata.

OmerBenGera avatar Feb 11 '24 04:02 OmerBenGera

I cannot tell exactly. I will get back to you once the user that reported the bug in my plugin answers. In the meantime yeah it would be nice to have the metadata.

SkytAsul avatar Feb 11 '24 12:02 SkytAsul

Have you looked into the events that are fired?

OmerBenGera avatar Mar 08 '24 12:03 OmerBenGera

Any news regarding this?

OmerBenGera avatar May 11 '24 17:05 OmerBenGera

Sorry, I've got no response about it. I will try to reproduce and let you know.

SkytAsul avatar May 11 '24 19:05 SkytAsul

I've succeeded in reproducing the problem: it is caused by World#getPlayers() returning a collection containing WildLoaders fake players.

SkytAsul avatar May 11 '24 19:05 SkytAsul

Check out latest dev build, NPCs should now have the "NPC" metadata.

OmerBenGera avatar May 24 '24 10:05 OmerBenGera

Thank you!

SkytAsul avatar May 24 '24 11:05 SkytAsul

Let me know if that all what you need and that it works

OmerBenGera avatar May 24 '24 11:05 OmerBenGera

Sorry not to have answered before, it works! Thank you very much.

SkytAsul avatar Aug 01 '24 15:08 SkytAsul