help with falling

Discussion in 'Plugin Development' started by josha28, Aug 16, 2017.

Thread Status:
Not open for further replies.
  1. i know and i need to check the health bevore the player get damage and i will do it when the player is still falling
     
  2. Online

    timtower Administrator Administrator Moderator

    @josha28 Event gets called before the damage gets applied.
     
  3. this is what needs to happen.
    Code:
    double bhealth = player.getHealth();   
    public void onFallDamage(EntityDamageEvent e) {
            Player player = (Player) e.getEntity();
            float falldistance = player.getFallDistance();
            player.sendMessage("" + falldistance);
            player.sendMessage("" + bhealth);
            if (player.isOnGround()) {
                player.sendMessage("flying");
                if (falldistance > 2.5f)
                    player.sendMessage("fallen");
                    if (e.getCause() == (DamageCause.FALL)) {
                        double ahealth = player.getHealth();
                        player.sendMessage("Health" + ahealth + bhealth);
                        if (ahealth == bhealth) {
                            player.sendMessage("Health:" + ahealth + " " + bhealth + "HACKER");
                        }
                    }
           
            }
        }
     
  4. Online

    timtower Administrator Administrator Moderator

    @josha28 Now the health still won't update, you still have the health before the damage gets applied.
     
  5. There was a previous thread here.
    It isn't in date and isn't exactly what you want but you will be able to get tips from there :)

    --EDIT--
    This may help also.
     
  6. Online

    timtower Administrator Administrator Moderator

    Although it is nice, it uses NMS (which isn't really good for new users) and it still has the random part that could be different from the server.
     
  7. Oh yeah, my bad.

    This will be of help if you are dealing with ticks.
     
Thread Status:
Not open for further replies.

Share This Page