Jump to content

Locking one target


Recommended Posts

Posted

Alright, so, if we do this;

		           NPC twat = getNpcs().closest(getNpcs().filter(n -> n.getName().contains("Twat") && n.hasAction("Attack") && n.isInteracting(myPlayer()) && getMap().canReach(n) && n.getHealthPercent() > 0 && n.isAttackable()));

And for custom interaction;

            		if (!getMouse().isOnCursor(entity)) {
                        MoveMouseEvent moveMouseEvent = new MoveMouseEvent(entity);
            		execute(moveMouseEvent).hasFinished();

If 2 entities are in the same distance to my player it'll try to hover both and eventually click on one.

So, is there any way of locking it to one target ?

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...