Minecraft wiki entry for Development_versions, associated text: Will drink a potion of fire resistance if they don't already have the effect and the most recent damage taken (within the past 2 seconds) was fire damage.