elbojoloco Posted November 28, 2018 Share Posted November 28, 2018 Hi, my getObjects().closest("Ore vein") seems to only look for Ore vein within a 3-4 tile radius, is there any way I can increase that to the whole screen or any bigger amount? Quote Link to comment Share on other sites More sharing options...
Chris Posted November 28, 2018 Share Posted November 28, 2018 getObjects().getAll() Quote Link to comment Share on other sites More sharing options...
elbojoloco Posted November 28, 2018 Author Share Posted November 28, 2018 12 hours ago, Chris said: getObjects().getAll() Thanks for your answer! Will this get all objects that are currently in my client/window? Quote Link to comment Share on other sites More sharing options...
jca Posted November 28, 2018 Share Posted November 28, 2018 10 minutes ago, elbojoloco said: Thanks for your answer! Will this get all objects that are currently in my client/window? It will get all objects in the loaded region Quote Link to comment Share on other sites More sharing options...
someguy567 Posted November 28, 2018 Share Posted November 28, 2018 getObjects().closest() should still work it's always worked for the full screen for me. Strange.. Quote Link to comment Share on other sites More sharing options...
elbojoloco Posted November 28, 2018 Author Share Posted November 28, 2018 4 hours ago, jca said: It will get all objects in the loaded region Hey, how do I get the closest to me from the getObjects().getAll() part? Quote Link to comment Share on other sites More sharing options...
jca Posted November 28, 2018 Share Posted November 28, 2018 3 hours ago, elbojoloco said: Hey, how do I get the closest to me from the getObjects().getAll() part? getObjects().closest("Ore vein") That will return the closest object with that name from all the objects in getObjects().getAll(), which returns all the objects in the loaded region. If you want to use getAll() use Java's stream API. getObjects().getAll().stream().filter(obj -> obj.getName().equalsIgnoreCase("Ore vein")).findFirst().orElse(null); That will return the first object in the collection with the name "Ore vein". If you want to compare distance that you have to use .min() Quote Link to comment Share on other sites More sharing options...