Class Spectator
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.participants.Spectator
A player watching a battle between other combatants.
-
Field Summary
Modifier and TypeFieldDescriptionThe name of the player who this spectator is watching from. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.server.level.ServerPlayer
Gets the player this spectator is representing.void
sendBattleMessage
(net.minecraft.network.chat.Component message) Sends a battle message to the spectator.void
sendDamagePacket
(PixelmonWrapper user, int damage) Updates the spectator about damage dealt to a Pokémon.void
sendHealPacket
(PixelmonWrapper target, int amount) Updates the spectator about a Pokémon healing.void
sendMessage
(PixelmonPacket message) Sends a battle update message to the spectator.
-
Field Details
-
watchedName
The name of the player who this spectator is watching from.
-
-
Constructor Details
-
Spectator
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
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
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
Sends a battle update message to the spectator.- Parameters:
message
- The message to send.
-