Jump to content
Sign in to follow this  
Halbschlau

Fehler bei Tabsystem Plugin

Recommended Posts

Hey, ich code gerade an einem Tabprefix Plugin, es werden bei Eclipse keine fehler angezeigt, aber das Plugin wird auf dem Server nicht erkannt -.-

 

Würde mich sehr freuen wenn ihr mir helfen könntet. 

 

 

Mfg Halbschlau

package de.halbschlau.Utils;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.scoreboard.Scoreboard;

public class Tablist {

	private static Scoreboard sb;
	
	public static void setScoreboard() {
		
		sb = Bukkit.getScoreboardManager().getNewScoreboard();
		
		sb.registerNewTeam("001Admin");
		sb.registerNewTeam("002Developer");
		sb.registerNewTeam("003SrModerator");
		sb.registerNewTeam("004Moderator");
		sb.registerNewTeam("005Supporter");
		sb.registerNewTeam("006Builder");
		sb.registerNewTeam("007Youtuber");
		sb.registerNewTeam("008Premium+");
		sb.registerNewTeam("009Premium");
		sb.registerNewTeam("010Spieler");
		
		sb.getTeam("001Admin").setPrefix("§4Admin §7| §4");
		sb.getTeam("002Developer").setPrefix("§bDev §7| §b");
		sb.getTeam("003SrModerator").setPrefix("§cSrMod §7| §c");
		sb.getTeam("004Moderator").setPrefix("§cMod §7| §4");
		sb.getTeam("005Supporter").setPrefix("§9Sup §7| §9");
		sb.getTeam("006Builder").setPrefix("§2Build §7| §2");
		sb.getTeam("007Youtuber").setPrefix("§5");
		sb.getTeam("008Premium+").setPrefix("§e");
		sb.getTeam("009Premium").setPrefix("§6");
		sb.getTeam("010Spieler").setPrefix("§a");
		
		
		
		for(Player all : Bukkit.getOnlinePlayers()) {
			setTeams(all);
		}
		
	
			
		}
	
	@SuppressWarnings("deprecation")
	private static void setTeams(Player p) {
		String team = "";
		
		if(p.hasPermission("Server.Admin") || p.isOp()) {
			team = "001Admin";
			
  } else {
	  team = "010Spieler";
  }
			
		sb.getTeam(team).addPlayer(p);
		p.setScoreboard(sb);
 }
	
	
}
package de.halbschlau.Main;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import de.halbschlau.PlayerJoinListener.PlayerJoinListener;

public class Main extends JavaPlugin {
	
	public static String prefix = "§7[§aTabsystem§7]";
	
	public void onEnable() {
		
		Bukkit.getConsoleSender().sendMessage(prefix + "Das Plugin wurde geladen!" );
		
		Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(), this);
	}

}
package de.halbschlau.PlayerJoinListener;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

import de.halbschlau.Utils.Tablist;

public class PlayerJoinListener implements Listener {
	
	@EventHandler
	public void onjoin(PlayerJoinEvent e) {
	    
		Tablist.setScoreboard();
	}
	

}

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...
B