brandon417 Posted October 27, 2015 Share Posted October 27, 2015 (edited) Hi people, I am new to writing scripts and have a very frustrating issue preventing my script from running. I have a simple script to pick wheat but when I try to call the EntityAPI methods, I get the error: Cannot make a static reference to the non-static method closest(String...) from the type EntityAPI. I am also pretty rusty with Java coding so if somebody could explain my mistake here that would be helpful. It's probably a simple solution but I cannot figure it out Some of my code: import org.osbot.rs07.api.EntityAPI; import org.osbot.rs07.api.model.Entity; final String WHEAT_NAME = "wheat"; public int onLoop(){ /* Only error of program is on this line */ Entity wheat = closest(WHEAT_NAME); //I have also tried EntityAPI.closest(WHEAT_NAME); return 0; } Edited October 27, 2015 by brandon417 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted October 27, 2015 Share Posted October 27, 2015 Entity wheat = getObjects().closest(WHEAT_NAME); Quote Link to comment Share on other sites More sharing options...
Joseph Posted October 27, 2015 Share Posted October 27, 2015 I would personally use RS2Object o = getObjects().closest("Wheat"); Rs2 object extend entity so it's the same shit. Quote Link to comment Share on other sites More sharing options...