Guest User

Untitled

a guest
Nov 9th, 2021
28
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package skypvp.main;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Location;
  6. import org.bukkit.World;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandSender;
  9. import org.bukkit.entity.Player;
  10. import org.bukkit.plugin.PluginManager;
  11. import org.bukkit.plugin.java.JavaPlugin;
  12. import org.bukkit.potion.PotionEffect;
  13. import org.bukkit.potion.PotionEffectType;
  14.  
  15. import skypvp.main.Main;
  16.  
  17. public class Main extends JavaPlugin {
  18.  
  19. @Override
  20. public void onEnable() {
  21.  
  22. }
  23. @Override
  24. public void onDisable() {
  25.  
  26. }
  27. public boolean onCommand(CommandSender sender, Command cmd, String label,String[] args) {
  28. if(cmd.getName().equalsIgnoreCase("Event-start")) {
  29. //Player player = (Player) sender;
  30. for (Player p : Bukkit.getServer().getOnlinePlayers()) {
  31. p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60000,2));
  32. p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 6000,3));
  33.  
  34. }
  35.  
  36.  
  37. int seconds = 6;
  38. Bukkit.broadcastMessage(ChatColor.RED+"["+ChatColor.AQUA+"SkyPvP"+ChatColor.RED+"] "+ChatColor.LIGHT_PURPLE+"Az event elindult, ölj meg minél több embert és szerezz sok pénzt!");
  39.  
  40. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  41. public void run() {
  42. Bukkit.broadcastMessage(ChatColor.RED+"["+ChatColor.AQUA+"SkyPvP"+ChatColor.RED+"] "+ChatColor.YELLOW+"Event vége!");
  43. }
  44. }, (seconds * 20)); // Always multiply by twenty because that's the amount of ticks in Minecraft
  45.  
  46. }
  47.  
  48. return false;
  49.  
  50.  
  51.  
  52.  
  53. }
  54. }
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
RAW Paste Data