Location Detect Method

Discussion in 'Plugin Development' started by ProMCKingz, Dec 19, 2014.

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

    ProMCKingz

    Hey, I was wondering what would be the best method to detect if a player is in a certain location?
    What I exactly need it for: I need to detect if (Pigs) with a custom name, are in a certain location, if they are, they should be dropped there (from passenger), and should not move from the point. The location is set in the config.

    I know how to do the minor bits like pigs, and passenger ejection; However I would need help with the method I need to use, and how to keep the sheep stationary. Thanks,

    @AdamQpzm
    AdamQpzm Sorry for tagging you, but you are too good in helping.
     
  2. Offline

    Skionz

  3. Offline

    ProMCKingz

    @Skionz
    That would be laggy?
    I previously used a walk event. However I thought that would also be laggy
     
  4. @ProMCKingz I'm confused, what are you trying to check? If a Pig is at a Location, or if a Player is? And what do you want to do with this information?
     
  5. Offline

    Skionz

    @ProMCKingz There is no walk event for pigs. Schedulers are the best way to go.
     
  6. Offline

    ProMCKingz

    @AdamQpzm
    Basically, I have the pig as a passenger on the player. I want it so that when the player reaches back to his/her team base it will give them one more point

    @Skionz
    The pig is a passenger, so it would work for a player walk event.
    if player is at location, eject pig, add point. Is there any better, less lagg consuming method?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
  7. @ProMCKingz And it's the Player that's moving, correct? I'd stick with a PlayerMoveEvent for this - you can simply check whether the location they're going to is their base, and give them a point/whatever else you want to do if it is. It shouldn't be that laggy, because the check should be quick to perform :)
     
  8. Offline

    Skionz

    @ProMCKingz Either would work but if you use the move event I wouldn't check for pitch or yaw changes and only use actual movement.
     
Thread Status:
Not open for further replies.

Share This Page