Solved Check if a player is jumping from 4 blocks high

Discussion in 'Plugin Development' started by someguyonthestreet, May 25, 2015.

Thread Status:
Not open for further replies.
  1. The title says it all.
    Right now I have:
    if (player.getFallDistance() >= 4) {
    but it doesn't seem to work.
     
  2. Offline

    teej107

    Do you want to see if they get damaged from 4 blocks high is see just how high they are from the ground when they jump?
     
  3. Send a message how high the fall distance is when they move / jump. Then you have how much it is
     
  4. @teej107
    I want to check if they damaged from 4+ blocks high.

    @FisheyLP
    I don't really know what your trying to tell me.
     
  5. Make a PlayerMoveEvent
    Send the player the fall distance
    Ingame, jump from 4 blocks
    In all the messages you got, find the highest fall distance and use this
     
  6. Offline

    teej107

  7. Offline

    EcMiner

    Problem is, you don't get damaged from a 4 block jump.
     
  8. @EcMiner Sure you do, fall damage starts at a four block fall - you can only fall 3 blocks without damage :)
     
  9. Offline

    EcMiner

    Yup you're right, I was probably testing at the wrong height :p Sorry :S
     
  10. @teej107
    So this is what I should do??:
    Call for Entitydamagebyentityevent
    check damage cause == fall
    if (player.getFallDistance() >= 4) {
    do code here

    but i'm not sure if it will work because im trying to detect if a player took damage from the fall and if they didn't I want to do some code.



    @FisheyLP
    I don't know how to send the player the fall distance.
     
    Last edited: May 26, 2015
  11. Offline

    teej107

    Listen in the EntityDamageEvent. Don't check the fall distance. Check for the damage and the damage cause.
     
  12. @teej107
    Thanks.

    EDIT: Fixed the issue with a friend
     
Thread Status:
Not open for further replies.

Share This Page