Salty as fuck Posted February 13, 2016 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
Token Posted February 13, 2016 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
Salty as fuck Posted February 13, 2016 Author 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
Molly Posted February 13, 2016 Posted February 13, 2016 You could always do: for(String item: lootItems){ if(groundItems.closest(item) != null) { //do some fun stuff } } 1
Salty as fuck Posted February 13, 2016 Author 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