Enable Fall Damage when player.setAllowFlight is true

Discussion in 'Spigot Plugin Development' started by Yoreni, May 18, 2017.

  1. hi is there a way where i can enable fall damager when player.setAllowFlight is set to true
  2. EntityDamageEvent and find the damage cause and set damage to what ever.
  3. That does not work cos you cant take fall damage when your flying
  4. They were saying to give the damage "manually".
  5. Yes iam just want to know how to do it (I hope i dont come acrose rude to you iam sorry if i do)
  6. On EntityDamageEvent, check if its a player, check if its cancelled, Check if player has AllowFlight, uncancel the event (event#setCancelled(false)). I believe that will do the work. (Also, dont forget to check the cause first before uncancelling it ^^)
  7. The EntityDamageEvent donst work when you fall while flying
  8. what is the purpose you are creating a damage while player is in flight mode? so we can work on with our creativity
  9. WAS


    I swear this is gone over all the time, and it's hard for the OP to get by people with the fact EntityDamageEvent doesn't fire. You can detect when the player lands, and do your damage. Alternatively you could use my PlayerAirEvents and use the PlayerLandedEvent.
    • Agree Agree x 1