Void damage?

Discussion in 'Spigot Plugin Development' started by yoje4li, May 7, 2015.

  1. Hello, I'm making a plugin, but I have a problem.
    I want to see if a player fall in a void, if the player is pushed or not, and who pushed the player.

    Does someone knows how I need to do this?

    - Yoje4li
     
  2. Players haven't been capable of being be "pushed" off blocks for a while (aside from water), unless I'm missing something here.

    As for checking Void Damage, check the EntityDamageEvent (I think), if the entity is a player (either it always is, or sometimes isn't) and see if the damage type is void.
     
  3. Inkzzz

    Resource Staff

    In EntityDamageEvent check if the DamageCause is Void Damage
     
  4. @CraftedFury & @Inkzzzmc , I mean, if a player is on a block, and someone hit him, so he fall of the block, in a void, so
    I can send every player a message like "Player 1 killed player 2"
     
  5. Inkzzz

    Resource Staff

    For EntityDeath / PlayerDeath event check for the last damage / cause of death.
     
    • Agree Agree x 1
  6. the cause of death will be void damage but he wants to see who pushed the player to die in void damage
    i think you can check the last damage made by player.
     
  7. Thanks, It works :).
    @Inkzzzmc & @MaRoTheTroLLeR And do you know how I can check when a player is in lava, who placed the lava?
     
  8. Yeah, or he could implement his own. Store a player, the player who damaged him and the time he was damaged by that player as instance variables in a object called DamagedPlayer or something. You could also have methods in the DamagedPlayer class like boolean wasDamagedBefore(time). Then when the player dies, get the list of DamagedPlayer instances you have in hashmap or something and test if the player was damaged recently. Of course this is just psuedocode.
    [Edit]: I didn't see the post about this that said you had solved your issue. Goodluck.
     
    #8 gogobebe2, May 7, 2015
    Last edited: May 7, 2015
  9. Yes :D i actualy wanted to say this :) that what im doing on my minigames plugins :)
    I agree with you.
     
    • Friendly Friendly x 1