Jump to content

Conditional Sleeps


investmentideas
 Share

Recommended Posts

I have created a follow player code and am trying to create the conditional sleep for it now. I want it to return if my player is within 1 tile of the person its trying to follow (as I dont know any command that knows if a player is following or not), can anyone help?

 

if (getPlayers().closest(followFilter) != null){
    getPlayers().closest(followFilter).interact("Follow");
    new ConditionalSleep(2000, 100) {
        @Override
        public boolean condition() throws InterruptedException {
            return //if the player I want to follow is within 1 tile of me;
        }
    }.sleep();
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...