SHARE
TWEET

Untitled

a guest Oct 21st, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package me.FiesteroCraft.ultralobby.widgets;
  2.  
  3. import java.text.SimpleDateFormat;
  4. import java.util.Date;
  5. import java.util.List;
  6. import java.util.Map.Entry;
  7.  
  8. import org.bukkit.Bukkit;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.event.EventHandler;
  11. import org.bukkit.event.Listener;
  12. import org.bukkit.event.player.PlayerJoinEvent;
  13. import org.bukkit.scoreboard.DisplaySlot;
  14. import org.bukkit.scoreboard.Objective;
  15. import org.bukkit.scoreboard.Scoreboard;
  16.  
  17. import me.FiesteroCraft.ultralobby.Main
  18.  
  19. public class SimpleScoreboard implements Listener{
  20.  
  21.     private Main plugin;
  22.    
  23.     public SimpleScoreboard(Main pl){
  24.         plugin = pl;
  25.     }
  26.    
  27.     Date now = new Date();
  28.     SimpleDateFormat format = new SimpleDateFormat("dd/MM/yy");
  29.  
  30.     @SuppressWarnings("deprecation")
  31.     public void DisplayScoreboard(Player player){
  32.     Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
  33.     player.setScoreboard(board);
  34.    
  35.     Objective obj1 = board.registerNewObjective("epiksmt", "dummy");
  36.     obj1.setDisplayName("§e§l>> §3§lEpiksMT §e§l<<");
  37.     obj1.setDisplaySlot(DisplaySlot.SIDEBAR);
  38.    
  39.    
  40.    
  41.     obj1.getScore("§7" + format.format(now)).setScore(16);
  42.     obj1.getScore(" ").setScore(15);
  43.     obj1.getScore("§3§lBienvenido!" ).setScore(14);
  44.     obj1.getScore("§a" + player.getName()).setScore(13);
  45.     obj1.getScore(" ").setScore(12);
  46.     obj1.getScore("§6§lPuntos: §5" + Main.playerPoints.getAPI().look(player.getName())).setScore(11);
  47.     obj1.getScore("§6§lEpikChests: §5Proximamente...").setScore(10);
  48.     obj1.getScore(" ").setScore(9);
  49.     obj1.getScore("§cNoticias: ").setScore(8);
  50.         }
  51.    
  52.     @EventHandler
  53.     public void onPlayerJoin(PlayerJoinEvent e){
  54.         Player player = e.getPlayer();
  55.         DisplayScoreboard(player);
  56.     }
  57. }
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