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
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.
@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"
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.
Thanks, It works . @Inkzzzmc & @MaRoTheTroLLeR And do you know how I can check when a player is in lava, who placed the lava?
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.