# Pet not fetching potion

**URL:** <https://discourse.codecombat.com/t/pet-not-fetching-potion/28711>\
**Category:** Level Help\
**Created:** [May 5, 2021, 2:07pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711 "2021-05-05T14:07:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thebagel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thebagel/32/22241_2.png) [@thebagel](https://discourse.codecombat.com/u/thebagel)\
**Post date:** [May 5, 2021, 2:07pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711/1 "2021-05-05T14:07:44Z")

</div>

Why won’t I “eat” the potion? I am not dead at this stage and the pet is at me, yet for a few seconds with me still being alive I don’t say the usual “I feel GREAT!!!”  
 ![Screen Shot 2021-05-05 at 10.06.32 AM](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/0/c/0c36872c00bd18ef5251c6270ee500444603442c.png)

---

<div class="post-metadata">

**Author:** ![Deadpool198](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/deadpool198/32/16753_2.png) [@Deadpool198](https://discourse.codecombat.com/u/Deadpool198)\
**Post date:** [May 5, 2021, 2:29pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711/2 "2021-05-05T14:29:45Z")

</div>

Have you used pet.fetch(), or pet.moveXY()? Maybe you need to make the pet move to your exact position, rather than either next to you, or where you _were_ when the pet moved.

---

<div class="post-metadata">

**Author:** ![thebagel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thebagel/32/22241_2.png) [@thebagel](https://discourse.codecombat.com/u/thebagel)\
**Post date:** [May 5, 2021, 2:31pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711/3 "2021-05-05T14:31:14Z")

</div>

I’ve used

```python
potion = pet.findNearestByType("potion")
if potion:
    pet.fetch(potion)

```

Ok I’ll try making the pet move to my pos

---

<div class="post-metadata">

**Author:** ![thebagel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thebagel/32/22241_2.png) [@thebagel](https://discourse.codecombat.com/u/thebagel)\
**Post date:** [May 5, 2021, 2:32pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711/4 "2021-05-05T14:32:40Z")

</div>

i tried that, it didn’t work

---

<div class="post-metadata">

**Author:** ![thebagel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/thebagel/32/22241_2.png) [@thebagel](https://discourse.codecombat.com/u/thebagel)\
**Post date:** [May 5, 2021, 2:33pm UTC](https://discourse.codecombat.com/t/pet-not-fetching-potion/28711/5 "2021-05-05T14:33:32Z")

</div>

I’ve put it in a function. THis is the function, and I’ve called it.

```python

def onSpawn(event):
    enemy = hero.findNearestEnemy()
    
    while True:
        enemies = hero.findEnemies()
        potion = pet.findNearestByType("potion")
        if potion:
            pet.fetch(potion)
            pet.moveXY(hero.pos.x,hero.pos.y)

```

but in other the kithgard brawl you helped me with, the one with the fire traps, fetching potion worked…
