Class SpeechEvent

java.lang.Object
org.bukkit.event.Event
net.citizensnpcs.api.ai.speech.event.SpeechEvent
All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
SpeechBystanderEvent, SpeechTargetedEvent

public class SpeechEvent extends Event implements Cancellable
Represents an event where a Talkable entity speaks at/near a Talkable entity.
  • Constructor Details

  • Method Details

    • getContext

      public SpeechContext getContext()
      Gets the SpeechContext associated with the SpeechEvent.
      Returns:
      the SpeechContext
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getMessage

      public String getMessage()
      The final message to be sent to the bystander. Note: This may differ from the message contained in the SpeechContext, as formatting may have occurred.
      Returns:
      the message to be sent to the Talkable bystander.
    • isCancelled

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

      public void setCancelled(boolean cancelled)
      Specified by:
      setCancelled in interface Cancellable
    • setMessage

      public void setMessage(String formattedMessage)
      Sets the message to be sent to the bystander. Note: This may differ from the message contained in the SpeechContext, as formatting may have occurred.
    • getHandlerList

      public static HandlerList getHandlerList()