i wanna set pvp for specific places

Discussion in 'Plugin Development' started by DeStickyOne, Dec 14, 2013.

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

    DeStickyOne

    without worldguard
    how can i do it ?
     
  2. Offline

    BeaztX

    I have not looked in to these stuff yet, but I'm pretty sure you can make regions type of things by using something like:
    @EventHandler
    public void onNoPvP(EntityDamageByEntityEvent e) {
    Player p = (Player) e.getEntity();
    Player attacker = (Player) e.getDamager();
    if(p.getLocation().getX() < 20) {
    if(p.getLocation().getZ() > 0) {
    e.setCancelled(true);
    attacker.sendMessage(ChatColor.RED + "No PvP In This Area!");

    Should work. (Btw wrote this in text format while typing this message, so there might be typos, also make it check entity types to prevent NullPointerExceptions) Hope that works
     
Thread Status:
Not open for further replies.

Share This Page