Your logic for selecting which pot to drink could be simplified:
Optional<Item> prayerPotion = Arrays.stream(getInventory().getItems())
.filter(item -> item != null && item.getName().startsWith("Prayer potion"))
.min(Comparator.comparing(Item::getName));
if (prayerPotion.isPresent()) {
Item pot = prayerPotion.get();
}