java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.Spectator

public class Spectator extends Object
A player watching a battle between other combatants.
  • Field Details

    • watchedName

      public String watchedName
      The name of the player who this spectator is watching from.
  • Constructor Details

    • Spectator

      public Spectator(net.minecraft.server.level.ServerPlayer player, String watchedName)
      Initializes a spectator.
      Parameters:
      player - The player this spectator is representing.
  • Method Details

    • getEntity

      public net.minecraft.server.level.ServerPlayer getEntity()
      Gets the player this spectator is representing.
      Returns:
      The player this spectator is representing.
    • sendDamagePacket

      public void sendDamagePacket(PixelmonWrapper user, int damage)
      Updates the spectator about damage dealt to a Pokémon.
      Parameters:
      user - The Pokémon being damaged.
      damage - The damage dealt to the Pokémon.
    • sendHealPacket

      public void sendHealPacket(PixelmonWrapper target, int amount)
      Updates the spectator about a Pokémon healing.
      Parameters:
      target - The Pokémon being healed.
      amount - The amount of health healed by the Pokémon.
    • sendBattleMessage

      public void sendBattleMessage(net.minecraft.network.chat.Component message)
      Sends a battle message to the spectator.
      Parameters:
      message - The message to send.
    • sendMessage

      public void sendMessage(PixelmonPacket message)
      Sends a battle update message to the spectator.
      Parameters:
      message - The message to send.