SteamWar/MissileWars
Archiviert
13
0

ActionBar on many players
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
Chaoscaot 2022-08-22 20:50:06 +02:00
Ursprung 9bf5aec1d4
Commit e61d1ae278

Datei anzeigen

@ -23,6 +23,8 @@ import de.steamwar.misslewars.FightState;
import de.steamwar.misslewars.MWTeam;
import de.steamwar.misslewars.MissileWars;
import de.steamwar.misslewars.SpawnPlatformCreator;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -48,8 +50,14 @@ public class DeathListener extends BasicListener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
e.setDeathMessage(null);
if(Bukkit.getOnlinePlayers().size() > 10) {
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
onlinePlayer.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(e.getEntity().getDisplayName() + " §cstarb"));
}
} else {
Bukkit.broadcastMessage(e.getEntity().getDisplayName() + " §cstarb");
}
}
@EventHandler
public void onRespawn(PlayerRespawnEvent e){