XenoTools Posted March 28, 2016 Share Posted March 28, 2016 Hey everyone, I'm attempting to get all of the ground item stacks around a player. I've been going through the documentation and I'm slightly confused on how to represent an ItemStack on the ground that should be looted. For example, say there's two item stacks on the ground. However I want to loot the item stack with the most items in it. I've looked at the class "GroundItemStack" but it seems to have absolutely no methods for obtaining information about the items even though the documentation say that it's a ground item container. "Represents a ground item container." Next I turned to "GroundItems" and I saw it had a .get(x, y) and a .getAll() which returned a List<>. However these are not available to me, as they do not exist. The only existing methods are gRandom(iiiiiiiiii) and random(iiiiiiii). I would have also of expected the GroundItemStack class to provide information on the item stack, such as the Position. If anyone can give me a nudge I'd be very greatful. Quote Link to comment Share on other sites More sharing options...
Token Posted March 28, 2016 Share Posted March 28, 2016 Your Script instance has a field called groundItems which you can use to access the whole collection of GroundItem instances currently available to your player as well as perform some other operations. For example the operation you mentioned is available to you in the following form groundItems.get(x, y); Quote Link to comment Share on other sites More sharing options...
FrostBug Posted March 28, 2016 Share Posted March 28, 2016 (edited) get(x, y) and getAll() should very much be available to you through the GroundItems class. As well as closest() and filter(), since the class extends API. It sounds like you're trying to access it statically, which won't work. Use it through MethodProvider Edited March 28, 2016 by FrostBug Quote Link to comment Share on other sites More sharing options...
XenoTools Posted March 28, 2016 Author Share Posted March 28, 2016 get(x, y) and getAll() should very much be available to you through the GroundItems class. As well as closest() and filter(), since the class extends API. It sounds like you're trying to access it statically, which won't work. Use it through MethodProvider Your Script instance has a field called groundItems which you can use to access the whole collection of GroundItem instances currently available to your player as well as perform some other operations. For example the operation you mentioned is available to you in the following formgroundItems.get(x, y); Oh doi, my lack of sleep had me looking for global getters. Thanks for pointing it out. Really need some rest. Quote Link to comment Share on other sites More sharing options...