Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Ground Item Null pointer

Joined
Jan 7, 2019
Messages
4
GroundItem fish = GroundItems.newQuery().names("Tuna").actions("Take").results().nearest();

fish.click();

When ever I run this code it returns with a null pointer even if there is tuna on the ground? What am I missing?


update: i took away the action() and it worked?
 
Last edited:
Joined
May 30, 2019
Messages
34
Code:
GroundItem fish = GroundItems.newQuery().names("Tuna").results().nearest();
if(fish != null){
    fish.interact("Take");
}
Would be a cleaner solution
 
Last edited:
Top