Class NPCInteractListener

java.lang.Object
com.ranull.graves.listener.integration.playernpc.NPCInteractListener
All Implemented Interfaces:
org.bukkit.event.Listener

public class NPCInteractListener extends Object implements 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 Details

    • NPCInteractListener

      public NPCInteractListener(Graves plugin, PlayerNPC playerNPC)
      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.