Jump to content

MInecraft plugin fuktioniert nicht


Tim0123
 Share

Recommended Posts

warum kann ich die Variable onlineZeitenS nicht unten im scoreboard benutzen bin neu

		Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.getPlugin(), new Runnable() {
			int onlineZeitS = 0;
			int onlineZeitM = 0;
			@Override
			public void run() {
				
				onlineZeitS++;
				
				if(onlineZeitS >= 60) {
					onlineZeitM = 1;
					onlineZeitS -= 60;
				}
				
			}
		}, 0, 20);
		
		Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
		Objective objective = board.registerNewObjective("abcd", "abcd");
		objective.setDisplaySlot(DisplaySlot.SIDEBAR);
		objective.setDisplayName("§6§lWillkommen!");
		objective.getScore(" ").setScore(4);
		objective.getScore("§aHallo §6" + player.getName() + "§a!").setScore(3);
		objective.getScore("§aViel Spaß auf dem Server!").setScore(2);
		objective.getScore("§du bist schon " + onlineZeiten);
		player.setScoreboard(board);
	}
Link to comment
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
 Share

×
×
  • Create New...
B
B