Disable PVP at spawn?

Discussion in 'Plugin Development' started by flyingtacoz, Oct 21, 2012.

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

    flyingtacoz

    Hello, is there a way to get the spawn location, and disable pvp there?
    I don't want to use worldguard or a related plugin, sorry.
     
  2. Offline

    Georgeto

    You have to manually check all possiblities a Player can hit an other.
    Listen to EntityDamageByEntityEvent and PotionSplashEvent, check if it is a fight between two players and check if it is located in the spawn area. If true cancel the event.
     
  3. Offline

    Waffletastic

    Or just do EntityDamageEvent, and disable it entirely at spawn.
     
  4. Offline

    flyingtacoz

    How exactly can I get the spawn location?

    Bump

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

    Woobie

    Code:
    Bukkit.getServer().getWorld().getSpawnLocation()));
    
    Something like that.
     
Thread Status:
Not open for further replies.

Share This Page