Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. package me.deeion.main;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.entity.Entity;
  5. import org.bukkit.plugin.java.JavaPlugin;
  6. import me.deeion.commands.KGLagg;
  7. import net.md_5.bungee.api.ChatColor;
  8.  
  9.  
  10. public class Main extends JavaPlugin{
  11.  
  12. public void onEnable() {
  13. System.out.println("(!) KG Plugin ^ON^");
  14. Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
  15.  
  16. @Override
  17. public void run() {
  18.  
  19. int totalEntities = 0;
  20. for (org.bukkit.World world : Bukkit.getServer().getWorlds()) {
  21. totalEntities = totalEntities+world.getEntities().size();
  22.  
  23. for (Entity entities : world.getEntities()) {
  24. entities.remove();
  25. }
  26. }
  27.  
  28.  
  29. Bukkit.broadcastMessage(ChatColor.AQUA + "" + totalEntities + du);
  30. }
  31.  
  32.  
  33.  
  34. }, 0L, 5000);
  35.  
  36.  
  37. getCommand("clearlagg").setExecutor(new KGLagg());
  38.  
  39. }
  40.  
  41. public void onDisable() {
  42. System.out.println("(!) KG Plugin ^OFF^");
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement