You are not logged in.

  • Login
Bitte besucht unser neues Forum unter https://forum.nitrado.net | Please visit our new Forum at https://forum.nitrado.net

Tntboy_HD

User / Kunde

  • "Tntboy_HD" started this thread

Posts: 3

  • Send private message

1

Saturday, February 9th 2019, 1:26am

Tablist Titel funktioniert nicht

Hey,
Ich programmiere derzeit ein Tablist Spieler prefix System und habe unerklärliche Probleme.
Kann mir jemand weiterhelfen?



Spoiler Spoiler



@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
Bukkit.getPluginManager().registerEvents(new ChatPrefix(), this);
this.getCommand("iTag").setExecutor(new iTagCMD());


sb = Bukkit.getScoreboardManager().getNewScoreboard();
sb.registerNewTeam("000Admin");
sb.registerNewTeam("001SrDev");
sb.registerNewTeam("002SrMod");
sb.registerNewTeam("003SrBuilder");
sb.registerNewTeam("004Developer");
sb.registerNewTeam("005Moderator");
sb.registerNewTeam("006Supporter");
sb.registerNewTeam("007Builder");
sb.registerNewTeam("008Designer");
sb.registerNewTeam("009T-Sup");
sb.registerNewTeam("010Freund");
sb.registerNewTeam("011YouTuber");
sb.registerNewTeam("012Emerald");
sb.registerNewTeam("013Diamond");
sb.registerNewTeam("014Gold+");
sb.registerNewTeam("015Gold");
sb.registerNewTeam("016Spieler");

sb.getTeam("000Admin").setPrefix("§4Admin §8┃ §4");
sb.getTeam("001SrDev").setPrefix("§9SrDev §8┃ §9");
sb.getTeam("002SrMod").setPrefix("§cSrMod §8┃ §c");
sb.getTeam("003SrBuilder").setPrefix("§3SrBuilder §8┃ §3");
sb.getTeam("004Developer").setPrefix("§9Dev §8┃ §9");
sb.getTeam("005Moderator").setPrefix("§cMod §8┃ §c");
sb.getTeam("006Supporter").setPrefix("§aSup §8┃ §a");
sb.getTeam("007Builder").setPrefix("§3Builder §8┃ §3");
sb.getTeam("008Designer").setPrefix("§2Designer §8┃ §2");
sb.getTeam("009T-Sup").setPrefix("§aT-Sup §8┃ §a");
sb.getTeam("010Freund").setPrefix("§dFreund §8┃ §d");
sb.getTeam("011YouTuber").setPrefix("§4YTber §8┃ §4");
sb.getTeam("012Emerald").setPrefix("§aEmerald §8┃ §a");
sb.getTeam("013Diamond").setPrefix("§bDiamond §8┃ §b");
sb.getTeam("014Gold+").setPrefix("§6Gold§a+ §8┃ §6");
sb.getTeam("015Gold").setPrefix("§6Gold §8┃ §6");
sb.getTeam("016Spieler").setPrefix("§7");

}


@SuppressWarnings("deprecation")
private void setPrefix(Player player) {
String team = "";



if(player.hasPermission("prefix.admin")){
team = "000Admin";
} else if(player.hasPermission("prefix.srdev")) {
team = "001SrDev";
} else if(player.hasPermission("prefix.srmod")) {
team = "002SrMod";
} else if(player.hasPermission("prefix.srbuilder")) {
team = "003SrBuilder";
} else if(player.hasPermission("prefix.dev")) {
team = "004Developer";
} else if(player.hasPermission("prefix.mod")) {
team = "005Moderator";
} else if(player.hasPermission("prefix.sup")) {
team = "006Supporter";
} else if(player.hasPermission("prefix.builder")) {
team = "007Builder";
} else if(player.hasPermission("prefix.designer")) {
team = "008Designer";
} else if(player.hasPermission("prefix.t-sup") ) {
team = "009T-Sup";
} else if(player.hasPermission("prefix.freund")) {
team = "010Freund";
} else if(player.hasPermission("prefix.youtuber")) {
team = "011YouTuber";
} else if(player.hasPermission("prefix.emerald")) {
team = "012Emerald";
} else if(player.hasPermission("prefix.diamond") ) {
team = "013Diamond";
} else if(player.hasPermission("prefix.gold+")) {
team = "014Gold+";
} else if(player.hasPermission("prefix.gold")) {
team = "015Gold";
} else {
team = "016Spieler";
}

sb.getTeam(team).addPlayer(player);
player.setDisplayName(sb.getTeam(team).getPrefix() + player.getName());

for (Player all : Bukkit.getOnlinePlayers()) {
all.setScoreboard(sb);
}
}

@EventHandler
public void onJoin(PlayerJoinEvent event){
new BukkitRunnable() {

@Override
public void run() {
setPrefix(event.getPlayer());
}
}.runTaskLaterAsynchronously(this, 1);
}


Danke schon mal im Vorraus.


Mit freundlichen Grüßen,
TntTastisch
Tntboy_HD has attached the following file:
Mit freundlichen Grüßen,
TntTastisch

This post has been edited 1 times, last edit by "Tntboy_HD" (Feb 9th 2019, 12:26pm)


thunfischbaum

User / Kunde

  • "thunfischbaum" is male

Posts: 254

Location: %JAVA_HOME%

Occupation: Fachinformatiker für Systemintegration

Thanks: 5

  • Send private message

2

Saturday, February 9th 2019, 2:50pm

Hi,
das hier wird dir sicher helfen

https://www.spigotmc.org/threads/bypass-…d-limit.155614/

Lg,
thunfischbaum

Bitte besucht unser neues Forum unter https://forum.nitrado.net| Please visit our new Forum at https://forum.nitrado.net

Similar threads