Class NPCChatEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.NPCChatEvent

public class NPCChatEvent extends net.minecraftforge.eventbus.api.Event
Event fired when a player begins a chat with an NPCChatting. Chat lines may be changed by sending a replacement ArrayList of Strings Canceling this event will prevent any interaction with the NPC.
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final NPCEntity
    The NPCChatting instance belonging to the NPC in question
    final net.minecraft.world.entity.player.Player
    The player interacting with the NPC
  • Constructor Summary

    Constructors
    Constructor
    Description
    NPCChatEvent(NPCEntity npc, net.minecraft.world.entity.player.Player player, ArrayList<String> chatlines)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    setChat(ArrayList<String> chatlines)
    Sets the new chat lines for the NPC

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • npc

      public final NPCEntity npc
      The NPCChatting instance belonging to the NPC in question
    • player

      public final net.minecraft.world.entity.player.Player player
      The player interacting with the NPC
  • Constructor Details

    • NPCChatEvent

      public NPCChatEvent(NPCEntity npc, net.minecraft.world.entity.player.Player player, ArrayList<String> chatlines)
  • Method Details

    • getChat

      public ArrayList<String> getChat()
      Returns:
      The ArrayList containing their chat lines in order. Change using setChat(...)
    • setChat

      public void setChat(ArrayList<String> chatlines)
      Sets the new chat lines for the NPC
      Parameters:
      chatlines - The ArrayList containing the new chat lines in order. If empty, the old chat lines will be used.