Class CommandSenderCreateNPCEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
CommandSenderCloneNPCEvent, PlayerCreateNPCEvent

public class CommandSenderCreateNPCEvent extends NPCCreateEvent implements Cancellable
  • Constructor Details

    • CommandSenderCreateNPCEvent

      public CommandSenderCreateNPCEvent(CommandSender sender, NPC npc)
  • Method Details

    • getCancelReason

      public String getCancelReason()
      Returns:
      The reason for cancelling the event
      See Also:
    • getCreator

      public CommandSender getCreator()
      Returns:
      The CommandSender creating the NPC.
    • getHandlers

      public HandlerList getHandlers()
      Overrides:
      getHandlers in class NPCCreateEvent
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface Cancellable
    • setCancelReason

      public void setCancelReason(String reason)
      Sets the reason for cancelling the event. This will be sent to the CommandSender creator to explain why the NPC cannot be created.
      Parameters:
      reason - The reason explaining the cancellation
    • getHandlerList

      public static HandlerList getHandlerList()