Creating an AOE knockback?

Discussion in 'Plugin Development' started by Tirelessly, Aug 19, 2012.

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

    Tirelessly

    Say I wanted to make it when someone right clicked with a stick, everyone near them got knocked back. I assume since tnt knocks people back in multiplayer now, I could create an explosion at that location. To stop the blocks from being damaged, would I need to use a blockbreakevent? And what about stopping the players from being damaged? Specifically because I want tnt to be on naturally aswell.
     
  2. Offline

    Timr

    Tirelessly likes this.
  3. Offline

    Tirelessly

    Perfect, thank you.

    If I do this, it doesn't knockback the players. Any idea?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 28, 2016
  4. Offline

    skore87

    I would go about doing this by first getting where they clicked, find all entities within X range and get a vector to each one and set that entities velocity to that vector with an added Y coordinate.
     
Thread Status:
Not open for further replies.

Share This Page