@Override
public WorldState generateState() {
List<Player> players = new ArrayList<Player>();
for (Player player : agent.getEntity().getWorld().getNearbyPlayers(agent.getEntity(), sensorRadius)) {
QuickbarInventory quickbar = PlayerUtil.getQuickbar(player);
if (quickbar == null) {
continue;
}
ItemStack selectedItem = quickbar.getSelectedItem();
if (selectedItem != null && material.equals(selectedItem.getMaterial())) {
players.add(player);
}
}
boolean found = players.size() > 0;