Kód: Vybrat vše
@SuppressWarnings("deprecation")
@EventHandler
public void onMove(PlayerMoveEvent e){
Location loc = e.getPlayer().getLocation().clone().subtract(0, 1, 0);
Block b = loc.getBlock();
if (b.getType() == Material.STAINED_CLAY && b.getData() == 5) {
e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 99999, 1, true), true);
} else {
e.getPlayer().removePotionEffect(PotionEffectType.INVISIBILITY);
}
}