mojira.dev
MCPE-103739

If you die while drinking a potion/eating food, you still consume it if gamerule keepInventory is true

This is a repost of MC-133218 for Bedrock Edition.

The bug

If you die before you can consume your potion, it still uses the potion and gives you any effects, but upon respawning it gets removed. This only works if you have /gamerule keepInventory true, since otherwise it would just drop the potion. This also affects food.

Reproduction steps

  1. Give yourself any consumable item.

  2. /gamemode s

  3. /tp ~ ~30 ~ or somehow be in the process of dying.

  4. Consume your item just before you die.

Note that if doimmediaterespawn is true, any corresponding effect will be given as if the player had consumed the potion/food properly.

Linked issues

Comments 2

I have the same issue. I drank a potion while on fire with keepinvenory on and the potion was consumed after I died. The drinking animation was still visible on the deaths screen.

Skaijie

(Unassigned)

445018

Confirmed

Multiple

1.17.0.56 Beta, 1.16.230.50 Beta, 1.16.210.55 Beta, 1.16.210.50 Beta, 1.16.40 Hotfix, ..., 1.17.41 Hotfix, 1.18.2 Hotfix, 1.20.12 Hotfix, 1.21.20, 1.21.81 Hotfix

Retrieved