Jump to content

How do i correctly get the number of a certain item in my inventory?


Recommended Posts

Posted (edited)
2 hours ago, chardragon said:

I am using

if(inventory.contains("Bruma root")){
    log("amt: " + inventory.getItem("Bruma root").getAmount());

}

However, it always returns 1 regardless of the number of items for example I have 5.

That's because you are checking the amount of that specific object in your inventory :) Would ahve worked if the item was stackable
What @xcx said is correct :)

Edited by Khaleesi

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