Class NpcInteractEvent

java.lang.Object
org.bukkit.event.Event
de.oliver.fancynpcs.api.events.NpcInteractEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class NpcInteractEvent extends org.bukkit.event.Event implements org.bukkit.event.Cancellable
Is fired when a player interacts with a NPC
  • Constructor Details

    • NpcInteractEvent

      public NpcInteractEvent(@NotNull @NotNull Npc npc, @NotNull @NotNull Consumer<org.bukkit.entity.Player> onClick, @NotNull @NotNull List<NpcAction.NpcActionData> actions, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull ActionTrigger actionTrigger)
  • Method Details

    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()
    • getNpc

      @NotNull public @NotNull Npc getNpc()
      Returns:
      the modified npc
    • getOnClick

      @NotNull public @NotNull Consumer<org.bukkit.entity.Player> getOnClick()
      Returns:
      the custom on click method that will run
    • getActions

      @Nullable public @Nullable List<NpcAction.NpcActionData> getActions()
      Returns:
      the actions that will run
    • getInteractionType

      @NotNull public @NotNull ActionTrigger getInteractionType()
      Returns:
      returns interaction type
    • getPlayer

      @NotNull public @NotNull org.bukkit.entity.Player getPlayer()
      Returns:
      the player who interacted with the npc
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface org.bukkit.event.Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface org.bukkit.event.Cancellable
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event