Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onStalker(PlayerInteractEvent e) {
- final Player p = (Player)e.getPlayer();
- if(Kits.StalkerKit.containsKey(p)) {
- if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
- if(p.getInventory().getItemInHand().getType() == Material.REDSTONE) {
- if(Kits.Stalkercd.contains(p)) {
- p.sendMessage(ChatColor.RED + "You must wait to use this agian!");
- }else{
- Kits.Stalkercd.add(p);
- p.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 400, 0));
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin) this, new BukkitRunnable(){
- public void run() {
- Kits.Stalkercd.remove(p);
- p.sendMessage(ChatColor.GREEN + "You may now stalk agian!");
- }
- }, 600L);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement