How would I go about this?

Discussion in 'Plugin Development' started by football70500, Nov 21, 2014.

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


    So I want to use worldguard and combat-log/combat-tag to make a plugin that says if you're tagged for 60 seconds, you cannot enter a certain region that has a custom worldguard flag. How would I go about this?
  2. Offline


    football70500 I would create a scheduler that constantly checks if the player is in the region and then check if the player is combat tagged and if they are apply a vector that launches them out of the region.
  3. Offline


    Instead of going through all the troubles with Schedulers just use PlayerMoveEvents:
    if player is combat logged
        playerIsWithinRegion method
        p.sendMessage(ChatColor.DARK_RED + "AW HELL NAW);
        set velocity to the reverse of their direction
    for playerIsWithin Region refer to this
    and if you don't want to run that every time a player moves
    1. if(e.getFrom().getX() == e.getTo().getX() && e.getFrom().getY()
    2. == e.getTo().getY() && e.getFrom().getZ() == e.getTo().getZ()) {
    3. return;
    4. }

    Just a bit of code to check if the movement was just a Yaw/Pitch movement
    rbrick likes this.
Thread Status:
Not open for further replies.

Share This Page