Class NPCInteractListener
java.lang.Object
com.ranull.graves.listener.integration.playernpc.NPCInteractListener
- All Implemented Interfaces:
org.bukkit.event.Listener
Listens for NPC interaction events and cancels the event if the player interacts with an NPC associated with a grave.
-
Constructor Summary
ConstructorsConstructorDescriptionNPCInteractListener
(Graves plugin, PlayerNPC playerNPC) Constructs a new NPCInteractListener with the specified Graves and PlayerNPC instances. -
Method Summary
Modifier and TypeMethodDescriptionvoid
onNPCInteract
(dev.sergiferry.playernpc.api.NPC.Events.Interact event) Handles NPC interaction events.
-
Constructor Details
-
NPCInteractListener
Constructs a new NPCInteractListener with the specified Graves and PlayerNPC instances.- Parameters:
plugin
- The Graves instance to use.playerNPC
- The PlayerNPC instance to use.
-
-
Method Details
-
onNPCInteract
public void onNPCInteract(dev.sergiferry.playernpc.api.NPC.Events.Interact event) Handles NPC interaction events. If the player right-clicks an NPC associated with a grave, it cancels the event and opens the grave for the player.- Parameters:
event
- The NPC.Events.Interact event to handle.
-