Hold down right click on a player to kill them.

Discussion in 'Plugin Development' started by VinexAx789, Jan 12, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    VinexAx789

    Hello, everyone I'm in need in some help. I'm trying to make a plugin that requires the player to be right clicked for 5 seconds after the 5 seconds he will die and an broadcast will announce player has been killed by player only part I need help with is figuring out how to do the hold down right click on the player and after 5 seconds of being held down kill them. ( player.setHealth(0); )

    Thanks.

    P.S. I have some code down for this I'll post it if necessary it's using the PlayerInteractEntityEvent.
     
  2. Offline

    Javlin

    Get the player's line of sight, and check if there is an entity at the block(s) they are looking at.
    EDIT: Might be a better way of doing this.
     
  3. Offline

    Zombie_Striker

    @VinexAx789
    The only way this will work would be @Javlin 's idea. The only problem is if the player is not looking at a block/ looking at the sky/ holding an item that cannot be right clicked, then the event will not be triggered. There is no real way of testing if a player right clicks for any amount of time because packets are not sent continuously.
     
  4. Offline

    VinexAx789

    @Zombie_Striker @Javlin Alright thanks. I've done it one way but it's only when the player gets clicked once.
     
Thread Status:
Not open for further replies.

Share This Page