Salty as fuck Posted February 13, 2016 Share Posted February 13, 2016 plis need halp String[] lootItems = { "apple", "orange", "banana" }; if (groundItems.closest(lootItems) != null { wherethemagichappens(); } doesn't werk ples halp tldr; script won't loot items from a string array Quote Link to comment Share on other sites More sharing options...
Token Posted February 13, 2016 Share Posted February 13, 2016 (edited) String[] lootItems = { "apple", "orange", "banana" }; if (groundItems.getAll().stream().filter(item -> Arrays.asList(lootItems).contains(item.getName())).count() > 0) { wherethemagichappens(); } Edited February 13, 2016 by Token 1 Quote Link to comment Share on other sites More sharing options...
Salty as fuck Posted February 13, 2016 Author Share Posted February 13, 2016 (edited) String[] lootItems = { "apple", "orange", "banana" }; if (groundItems.getAll().stream().filter(item -> Arrays.asList(lootItems).contains(item.getName())).count() > 0) { wherethemagichappens(); } so halpful thx edit: actually, i need your 'item' variable or whatever you set item as lol Edited February 13, 2016 by Reminiscence Quote Link to comment Share on other sites More sharing options...
Molly Posted February 13, 2016 Share Posted February 13, 2016 You could always do: for(String item: lootItems){ if(groundItems.closest(item) != null) { //do some fun stuff } } 1 Quote Link to comment Share on other sites More sharing options...
Salty as fuck Posted February 13, 2016 Author Share Posted February 13, 2016 You could always do: for(String item: lootItems){ if(groundItems.closest(item) != null) { //do some fun stuff } } thx bae, it worked 1 Quote Link to comment Share on other sites More sharing options...
Molly Posted February 13, 2016 Share Posted February 13, 2016 No problem! Quote Link to comment Share on other sites More sharing options...