Hello everyone! I need help with coding, i have code my second plugin, and that is a Double-Jump plugin, but if i double-jump i get fall damage, does someone has the code that you don't get fall damage? Thank you, Jasper
You could create a Listener where in you call for the event: EntityDamageEvent and in there check the case == DamageCause.FALL than cancel it. Example: Code (Text): @EventHandler public void onDamage(EntityDamageEvent event){ if(event.getEntity() instanceof Player){ Player p = (Player) event.getEntity(); if(event.getCause() == DamageCause.FALL){ event.setCancelled(true); } if(p.getLastDamageCause().getCause() == DamageCause.FALL){ event.setCancelled(true); } } } }
http://www.spigotmc.org/resources/nofall.3492/ http://dev.bukkit.org/bukkit-plugins/disablefalldamage/ https://github.com/Cewlt/NoFall/blob/master/com/colt/NoFall/NoFall.java btw, JasperB, this is the wrong section. since you're asking for help with developing, this should be in the "Spigot Plugin Development" forum section.
Thanks man! I'am really new to spigot. So i need to figure it out! That's why i was in the wrong section