Jump to content

Conditional Sleeps


Recommended Posts

Posted

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();
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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