FancyMcPlugins / FancyNpcs

FancyNpcs is a simple, lightweight and fast npc plugin using packets
https://modrinth.com/plugin/fancynpcs
MIT License
100 stars 23 forks source link

add NpcStartLookingEvent and NpcStopLookingEvent #36

Closed Grabsky closed 10 months ago

Grabsky commented 10 months ago

Useful for triggering some action (eg. sending a chat message) when player approaches NPC.

Implementation required creating new HashMap<UUID, Boolean> inside NPC object to properly detect when NPC starts and stops looking at a player. Plugin now also listens for PlayerQuitEvent to mark disconnected players as no longer being "seen/targetted" by NPCs.

Grabsky commented 10 months ago

Updated with some changes: