Fandom

WoWWiki

API GetPetFoodTypes

104,672pages on
this wiki
Add New Page
Talk0 Share
WoW API < GetPetFoodTypes

Returns the food types the current pet can eat.

local petFoodList = { GetPetFoodTypes() };

Returns Edit

multiple Strings (not a table)


Possible strings Edit

  • Meat
  • Fish
  • Fruit
  • Fungus
  • Bread
  • Cheese


Example Edit

To print every string from the list into the default chatframe.

local petFoodList = { GetPetFoodTypes() };
if #petFoodList > 0 then
    local index, foodType;
    for index, foodType in pairs(petFoodList) do
        DEFAULT_CHAT_FRAME:AddMessage(foodType);
    end
else
    DEFAULT_CHAT_FRAME:AddMessage("No pet food types available.");
end

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki