Jump to content

Interacting with items


Recommended Posts

  • 2 weeks later...
Posted (edited)

Do you mean something like this ?

//here is a method if you dont know the item name
	
public void inventory() throws InterruptedException {
		Item inv = getInventory().getItem(item -> item.hasAction("Action"));
       inv.interact("Action");
  }

 
   //here is other method to get it working by item name if you have the name

           public void inventory() {
                Item l = getInventory().getItem("Lobster");
          l.interact("Eat");
    }

inLoop add this:

inventory();
Edited by Mr Pro Pop
Posted

Hello, I was wondering if it was possible to use/open all items of one type in inventory, as efficiently as possible (relative to game ticks)

Thanks

 

Write a method which populates a list of events, and then use a range-based for loop to execute them.

 

For whatever reason (possibly a limitation of Java, the client, or my slow computer), trying to execute multiple within a ~25ms time-frame will cause bad things to happen. 

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