Thaantje Posted May 10, 2015 Posted May 10, 2015 Hey All, I can't figure out a way to get every item in my inventory, then select most bottom spot and then interact with it. Any directions?
Flamezzz Posted May 10, 2015 Posted May 10, 2015 inventory.getItems()returns an array of itemsindex it with length-1 to get the last Item object if length > 0 then use item.interact()
Fruity Posted May 10, 2015 Posted May 10, 2015 Item[] contents = inventory.getItems(); if (contents.length > 0) { if (inventory.interact("Interact with this shiz", contents[contents.length - 1].toString())); } Something like this i would assume. i have not tested it or anything but you could try it and tell me how it goes! :P