Vinetos

GM3 on Water

Aug 13th, 2015
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     @EventHandler
  2.     public void onMovePlayer(PlayerMoveEvent e){
  3.        
  4.         Player p = e.getPlayer();
  5.        
  6.         if(p.getLocation().getBlock().getRelative(0, -1, 0).getType() == Material.STAINED_CLAY){
  7.             p.getLocation().getBlock().getRelative(0, -1, 0).setType(Material.AIR);
  8.         }
  9.        
  10.         if(p.getLocation().getBlock().getType() == Material.WATER || p.getLocation().getBlock().getType() == Material.STATIONARY_WATER){
  11.             Bukkit.runTaskLater(Plugin, new Runnable(){
  12.                 public void run(){
  13.                     p.setGameMode(GameMode.SPECTATOR);
  14.                 }
  15.             },20);
  16.            
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment