I am trying to make a simple NoFall plugin but un event-setCancelled(true) I get the error Unreachable statement. Any ideas? Please help me.http://pastebin.com/Ak4mBTHg
remove the "return;" halfway through the code - this immediately terminates the method at that position.
@EventHandler public void onEntityDamage(final EntityDamageEvent event) { if (!(event.getEntity() instanceof Player)) { return; } Player player = (Player) event.getEntity(); World w = player.getWorld(); if (w.getName().equalsIgnoreCase("hub")) { if ((event.getCause().equals(EntityDamageEvent.DamageCause.FALL))) { event.setCancelled(true); } }