GetPetFoodTypes

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.0.0 / 1.13.2

Returns the food types the pet can eat.

petFoodList = { GetPetFoodTypes() }

Returns

multiple Strings (not a table)

Possible strings

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

Example

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