Jump to content

FOOD API


Doout

Recommended Posts


   /**

     * @return The item that is edible to eat.

     * @author Baheer

     */

    public Item getEdibleItem() {

        Item[] is = client.getInventory().getItems();

        for (Item i : is) {

            if (i == null) continue;

            if (i.getDefinition() == null || i.getDefinition().getActions() == null

                    || i.getDefinition().getActions()[0] == null) {

                continue;

            }

            if (i.getDefinition().getActions()[0].contains("Eat")) {

                return i;

            }

        }

        return null;

    }

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...