How to return damage.

Discussion in 'Plugin Development' started by KuriyamaPrincess, Nov 24, 2019.

Thread Status:
Not open for further replies.
  1. I’m doing a double jump plugin, while driving I turn on the player’s flight, but along with it the damage from falling off. How to return damage, but so that the flight remains?
  2. Offline


  3. Offline


    I'm assuming you are using a translator, and a not very good one at that lol.

    If you mean how to cancel the damage, listen to the event and cancel if the criteria matches. So like to cancel fall damage:
    public void ouch(EntityDamageEvent e) {
      if (e.getCause() != DamageCause.FALL) return;
    Now, that will cancel all fall damage no matter what. You'd obviously want to add criteria for your needs.

    If that wasn't what you meant, try rephrasing as KarimAKL asked. Or if English is not your regular language, see if you can have a friend translate for you instead of whatever you were using.
Thread Status:
Not open for further replies.

Share This Page