Class ChatHandler

java.lang.Object
com.pixelmonmod.pixelmon.comm.ChatHandler

public class ChatHandler extends Object
Methods to send messages to chat or battles.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.network.chat.MutableComponent
    getMessage(String string, Object... data)
    Gets a translated message for later use.
    static void
    sendBattleMessage(List<BattleParticipant> participants, String string, Object... data)
    Sends a battle message to participants in a battle.
    static void
    sendBattleMessage(List<BattleParticipant> participants, net.minecraft.network.chat.Component message)
    Sends a battle message to all participants in a battle.
    static void
    sendBattleMessage(net.minecraft.world.entity.Entity user, String string, Object... data)
    Sends a battle message to a player.
    static void
    sendBattleMessage(net.minecraft.world.entity.Entity user, net.minecraft.network.chat.Component chat)
    Sends a battle message to a player.
    static void
    sendChat(net.minecraft.commands.CommandSource owner, net.minecraft.commands.CommandSource owner2, String string, Object... data)
    Sends a message to two players.
    static void
    sendChat(net.minecraft.commands.CommandSource receiver, net.minecraft.network.chat.Component message)
    Sends a message to a player.
    static void
    sendChat(net.minecraft.world.entity.Entity entityLiving, String string, Object... data)
    Sends a message to a player.
    static void
    sendFormattedChat(net.minecraft.commands.CommandSource receiver, net.minecraft.ChatFormatting chatFormat, String string, Object... data)
    Sends a formatted message to a player.
    static void
    sendMessageToAllPlayers(net.minecraft.server.MinecraftServer minecraftServer, String string, Object... data)
    Sends a message to all players on the server.

    Methods inherited from class java.lang.Object

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

    • ChatHandler

      public ChatHandler()
  • Method Details

    • sendChat

      public static void sendChat(net.minecraft.world.entity.Entity entityLiving, String string, Object... data)
      Sends a message to a player.
      Parameters:
      entityLiving - The player to send the message to.
      string - The message to send.
      data - Additional arguments for the message.
    • sendChat

      public static void sendChat(net.minecraft.commands.CommandSource receiver, net.minecraft.network.chat.Component message)
      Sends a message to a player.
      Parameters:
      receiver - The player to send the message to.
      message - The message to send.
    • sendChat

      public static void sendChat(net.minecraft.commands.CommandSource owner, net.minecraft.commands.CommandSource owner2, String string, Object... data)
      Sends a message to two players.
      Parameters:
      owner - A player to send the message to.
      owner2 - A player to send the message to.
      string - The message to send.
      data - Additional arguments for the message.
    • sendFormattedChat

      public static void sendFormattedChat(net.minecraft.commands.CommandSource receiver, net.minecraft.ChatFormatting chatFormat, String string, Object... data)
      Sends a formatted message to a player.
      Parameters:
      receiver - The player to send the message to.
      chatFormat - The format to apply to the message.
      string - The message to send.
      data - Additional arguments for the message.
    • sendBattleMessage

      public static void sendBattleMessage(net.minecraft.world.entity.Entity user, String string, Object... data)
      Sends a battle message to a player.
      Parameters:
      user - The player to send the message to.
      string - The message to send.
      data - Additional arguments for the message.
    • sendBattleMessage

      public static void sendBattleMessage(net.minecraft.world.entity.Entity user, net.minecraft.network.chat.Component chat)
      Sends a battle message to a player.
      Parameters:
      user - The player to send the message to.
      chat - The message to send.
    • sendBattleMessage

      public static void sendBattleMessage(List<BattleParticipant> participants, String string, Object... data)
      Sends a battle message to participants in a battle.
      Parameters:
      participants - The participants of the battle to send a message to.
      string - The message to send.
      data - Additional arguments for the message.
    • sendBattleMessage

      public static void sendBattleMessage(List<BattleParticipant> participants, net.minecraft.network.chat.Component message)
      Sends a battle message to all participants in a battle.
      Parameters:
      participants - The participants of the battle.
      message - The message to send.
    • getMessage

      public static net.minecraft.network.chat.MutableComponent getMessage(String string, Object... data)
      Gets a translated message for later use.
      Parameters:
      string - The base message.
      data - Additional arguments for the message.
      Returns:
      The translated message.
    • sendMessageToAllPlayers

      public static void sendMessageToAllPlayers(net.minecraft.server.MinecraftServer minecraftServer, String string, Object... data)
      Sends a message to all players on the server.
      Parameters:
      minecraftServer -
      string - The message to send.