Advertisement
philitup321

Code

Mar 4th, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. @SuppressWarnings("deprecation")
  2. @EventHandler
  3. public void onPlayerMove(final PlayerMoveEvent e) {
  4.     Player player = e.getPlayer();
  5.     if (player.getName().equals("philitup321")){
  6.         if (player.getName().equals("zombies24")){
  7.        
  8.          
  9.             getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
  10.             public void run() {
  11.          
  12.                 Player player = e.getPlayer();
  13.                 LivingEntity living = (LivingEntity) player;
  14.                 if(player.getNearbyEntities(10, 10, 10).equals(EntityType.SKELETON) ){
  15.         if(player.getItemInHand().equals(Material.IRON_SWORD)) {
  16.        
  17.         player.getInventory().setItemInHand(addGlow(player.getItemInHand()));
  18.        
  19.             player.sendMessage(ChatColor.RED + " There are monsters nearby!!!");
  20.             player.playSound(player.getLocation(), Sound.AMBIENCE_CAVE, 1, 1);
  21.         }
  22.         }
  23.        
  24.        
  25.         }
  26.        
  27.        
  28.        
  29.             }, 0, 1 * 20);
  30.        
  31.         }
  32.         }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement