No fall damage!

Discussion in 'Spigot Plugin Help' started by JasperB, May 10, 2015.

  1. 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
     
  2. there is a plugin that completely disables fall damage. "NoFall".
     
  3. Essentials can remove fall damage if you are using essentials.
     
  4. 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);
                    }
                }
        }
    }
     
     
  5. 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.
     
  6. Thanks man! :)
    I'am really new to spigot. So i need to figure it out! That's why i was in the wrong section :)