SHARE
TWEET

ScoreboardListener

a guest Jun 27th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.etCraft.PrimeCraft.listeners;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.Listener;
  6. import org.bukkit.scoreboard.DisplaySlot;
  7. import org.bukkit.scoreboard.Objective;
  8. import org.bukkit.scoreboard.Scoreboard;
  9.  
  10. public class ScoreboardListener implements Listener {
  11.    
  12.    
  13.     public void setup(Player player) {
  14.  
  15.            
  16.         Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
  17.         Objective objective = scoreboard.registerNewObjective("abcd", "abcd");
  18.        
  19.         objective.setDisplayName("§2Prime§bCraft");
  20.         objective.setDisplaySlot(DisplaySlot.SIDEBAR);
  21.        
  22.         objective.getScore("§eName:").setScore(10);
  23.         objective.getScore("§f" + player.getName()).setScore(9);
  24.         objective.getScore("§a ").setScore(8);
  25.         objective.getScore("§eRang:").setScore(7);
  26.         objective.getScore("§bDeveloper").setScore(6);
  27.         objective.getScore("§b ").setScore(5);
  28.         objective.getScore("§eOnlinePlayers:").setScore(4);       
  29.         objective.getScore(Bukkit.getOnlinePlayers().size() + " / " + Bukkit.getMaxPlayers()).setScore(3);
  30.         objective.getScore(" ").setScore(2);
  31.         objective.getScore("§eGuthaben").setScore(1);
  32.         objective.getScore("0€").setScore(0);
  33.         player.setScoreboard(scoreboard);
  34.     }
  35.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top