Jump to content

Interacting with NPC


Frukzz

Recommended Posts

Hi

i cant find any examples of how to interact with an NPC and i have a bit of trouble understanding the API documentation properly.
Could someone give me an example on how this is done? 🙂

Link to comment
Share on other sites

        Npc npc = Query.npcs()
                .nameEquals("Npc Name")
                .findFirst()
                .orElse(null);

		npc.interact("Talk-to")
		Waiting.waitUntil(npc::isInteractingWithMe);

I figured it out, hope it helps someone else 🙂

Link to comment
Share on other sites

You can do
 

if(Query.npcs().nameContains("name").findClosest().map(n-> n.interact("Talk-to").orElse(false)){
	 Waiting.waitUntil(5000, 100, ChatScreen:isOpen);
}

 

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.

×
×
  • Create New...