View difference between Paste ID: dSk7tWwd and tNUtwrNK
SHOW: | | - or go back to the newest paste.
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-
			p.setGameMode(GameMode.SPECTATOR);
11+
			Bukkit.runTaskLater(Plugin, new Runnable(){
12
				public void run(){
13
					p.setGameMode(GameMode.SPECTATOR);
14
				}
15
			},20);
16
			
17
		}
18
	}