Trying to give players strength and speed if there in the water but it doesn't give them any potion effects. My code: Code:java @EventHandler public void playerMove(PlayerMoveEvent e){ Player p = e.getPlayer(); Location loc = p.getLocation(); if(Main.mist.contains(p.getName())){ if(loc.getBlock() == new ItemStack(Material.WATER)){ p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 20 , 1)); p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 , 1)); } } }
Code: @EventHandler public void playerMove(PlayerMoveEvent e){ Player p = e.getPlayer(); Location loc = p.getLocation(); if(Main.mist.contains(p.getName())){ if(loc.getBlock().getType() == Material.WATER){ p.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 20 , 1)); p.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20 , 1)); } } } I think that should work