Void damage?

Discussion in 'Spigot Plugin Development' started by Bear53, May 8, 2015.

  1. In one of my plugins im trying to have when a player is knocked off into the void and was hit off by a player it would set the death message. I cannot find out how to get if the damager was a player and if the death cause was void damage in one event. I don't really support spoon feeding code, but if its possible if someone could push me in the right direction that would be great thanks so much!
  2. NathanWolf


    You can check the last damage cause for an Entity, there is a DamageCause enum value in that object, you can look for VOID that way.
  3. Hey, use a entitydamageEvent.

    You cannot check if damagecause is voud in a entitydamagebyentityevent. So get your entitydamageevent and check if your damager is a player and check if he is in the void. So if the y < 1 or something.
    Then create a message and create a damager player variable and set it in your message.
    #3 Svenna, May 8, 2015
    Last edited: May 8, 2015
  4. Check if the 'y' is less than 0 in entity damage event