Move to the right side of the forest.
This function should check for items near the pet and fetch them.
def fetchPotions(event):
# Complete this function:
# Don’t forget to use a “while-true loop”:
item = hero.findNearestItem()
if item:
pet.fetch(item)
pass
while True:
health = hero.maxHealth
x = hero.pos.x
if health < hero.maxHealth/3:
pet.on(“spawn”, fetchPotions)
else:
hero.moveXY(x + 20, 35)
pass