vladbuff Posted January 8 Share Posted January 8 (edited) Trying to make my 1st script and having issues identifying an amount of item in my inventory by the ID. I read the API and found the getAmount() method but I cant seem to properly pass it the correct parameters. Ive been able to get it to successfully take the correct item ID (I think) but I cant seem to get it to interact with the correct container. long copperAmount = 0; public long getAmount(int... ids){ return copperAmount; } public final String copperOreAmount(final long ms){ long amt = getAmount(436); return String.format("%02d", amt); } I have code in my onPaint() that prints out the result of copperAmount that looks like this to debug the results g.drawString(copperOreAmount(getAmount()), 300, 300); It will only print out 0 even though I have the item in my inventory and i'm worried that my print statement may be incorrect or that i may be inputting the parameters of getAmount() incorrectly or if my return statement is incorrect or something im missing entirely. ive also tried typing it is Inventory.getAmount() to ensure it was pulling from the inventory container and not just interacting with nothing but it gave me an error about a static method interacting with a non static method but when i made everything static it would just throw the same error. Edited January 8 by vladbuff Link to comment Share on other sites More sharing options...
vladbuff Posted January 8 Author Share Posted January 8 realized i was being an idiot and just not using it correctly looked through other threads in this section Link to comment Share on other sites More sharing options...
Khaleesi Posted January 8 Share Posted January 8 (edited) You can simply do: getInventory().getAmount("Copper ore") Edited January 8 by Khaleesi Link to comment Share on other sites More sharing options...