November 28, 20187 yr 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?
November 28, 20187 yr Author 12 hours ago, Chris said: getObjects().getAll() Thanks for your answer! Will this get all objects that are currently in my client/window?
November 28, 20187 yr 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
November 28, 20187 yr getObjects().closest() should still work it's always worked for the full screen for me. Strange..
November 28, 20187 yr Author 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?
November 28, 20187 yr 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()
Create an account or sign in to comment