Not getting potion effect when entering heal region

Discussion in 'Plugin Development' started by immensebuttpain, Feb 3, 2014.

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

    immensebuttpain

    Here's the code:
    Code:java
    1. Region region = FFA.getRegion();
    2. HealRegion healRegion = FFA.getHealRegion();
    3. Vector pt = toVector(to);
    4. Vector pf = toVector(from);
    5. World world = evtPlayer.getWorld();
    6. if (region.contains(world, pt)) {
    7. if (healRegion != null) {
    8. if (healRegion.contains(world, pt) && !healRegion.contains(world, pf)) {
    9. Player p = evt.getPlayer();
    10. p.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 1, 2));
    11. evtPlayer.sendMessage(ChatColor.YELLOW + "[FearForAll]" + ChatColor.RED + " You have entered the heal region.");
    12. }
    13. if (!healRegion.contains(world, pt) && healRegion.contains(world, pf)) {
    14. evtPlayer.sendMessage(ChatColor.YELLOW + "[FearForAll]" + ChatColor.RED + " You have left the heal region.");
    15. }
    16. }
    17. }

    When i enter the heal region it says in chat that:

    [​IMG]
     
  2. Offline

    Gater12

    immensebuttpain
    Is it in a repeating task? Because you are only giving them the effect for a tick.
     
  3. Offline

    immensebuttpain

    Gater12
    Ok how do i make it so it will keep a level 3 regeneration on me as long as i'm in the region?
     
Thread Status:
Not open for further replies.

Share This Page