Hallo,
was ist eig. an diesem code falsch, es geht um bukkit api (mit eclipse (java)):
ZitatAlles anzeigen
public final class listener extends JavaPlugin implements Listener {
public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event){
Player p = event.getPlayer();
p.sendMessage("§4STARTED");
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective objective = board.registerNewObjective("showhealth", "health");
objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
objective.setDisplayName("/ 20");
for(Player online : Bukkit.getOnlinePlayers()){
online.setScoreboard(board);
online.setHealth(online.getHealth()); //Update their health
}
}
}
also wenn ich es exportiere, und server restarte, kommt nciht unter dem namen des Spielers.
warum?
mfg hemran