Enabling PvP?

Discussion in 'Plugin Development' started by sessp, Nov 19, 2014.

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

    sessp

    How do i enable pvp when a player interacts with a item?
     
  2. Offline

    lenis0012

    manually disable pvp using EntityAttackByEntityEvent
    cancel this if pvp is disabled for the player being attacked or the player who is attacking.
    you can also use Essentials api if you wish
     
  3. Offline

    leon3001

    sessp Create a HashMap with the player's name/UUID and a boolean. On EntityDamageByEntityEvent, check the boolean for the specific player and cancel it. To set the boolean, use PlayerInteractEvent.
     
  4. Offline

    teej107

    leon3001 Or you can just use a Set and assume that players that aren't in the set have PvP disabled.
     
  5. Offline

    sessp

    ok how would i do that?
     
  6. Offline

    leon3001

    sessp In code? Nah, no one is going to spoonfeed any code. Everything you need to know is on the Javadocs, man.
     
    xTrollxDudex likes this.
  7. Offline

    teej107

    Think and believe in yourself!
     
    BetaNyan likes this.
Thread Status:
Not open for further replies.

Share This Page