Advertisement
Guest User

Untitled

a guest
Sep 10th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. @EventHandler
  2. public void onStalker(PlayerInteractEvent e) {
  3. final Player p = (Player)e.getPlayer();
  4. if(Kits.StalkerKit.containsKey(p)) {
  5. if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
  6. if(p.getInventory().getItemInHand().getType() == Material.REDSTONE) {
  7. if(Kits.Stalkercd.contains(p)) {
  8. p.sendMessage(ChatColor.RED + "You must wait to use this agian!");
  9. }else{
  10. Kits.Stalkercd.add(p);
  11. p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 400, 0));
  12. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin) this, new BukkitRunnable(){
  13. public void run() {
  14. Kits.Stalkercd.remove(p);
  15. p.sendMessage(ChatColor.GREEN + "You may now stalk agian!");
  16. }
  17. }, 600L);
  18. }
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement