Mojira Archive
MCM-1748

Teleporting while using an item forces player to finish using that item

Partner Rank:
2

Partner Team Reporting:
Everbloom Games

Verification builds:
1.20.60.26_rc0

Summary:
Teleporting a player when they start using an item forces them to finish using that item, even if they let go of the Use Item button.
As a consequence, the q.is_using_item query and ItemStopUseAfterEvent signal don't get updated/fired when the user lets go of the Use Item button until they select a different item or re-press and let go of the button.

Impact:

We very commonly use food items with long use durations, in conjunction with q.is_using_item to accurately detect when the player presses and lets go of the Use Item action. This bug makes this trick unreliable and leads to confusion for the player.

This bug makes the menu in our Dungeons & Dragons unreliable, as opening it teleports you to re-sync your position with the server, and using the item is one of the ways of opening the menu. Out of necessity we also stop detecting directional inputs in the menu while the Use Item button is held to avoid confusion, so this bug causes the player to be unable to use the menu until they reopen it, or think to press Use Item again.

We also use this trick in a lot of other maps, especially some currently ongoing projects.

Repro Steps:

  1. Open the provided world.
    This world is set up to send a chat message when you start using items, when you stop using items, and one every tick you are using an item.
    Also, this teleports you to yourself the tick you start using an item.
  2. Hold the Golden Apples
  3. Tap (don't hold!) the Use Item action a couple times (right click on PC)
  4. Observe the chat messages and your potion effects.

Observed Results:

Nearly all the time, when you tap Use Item, the following occurs:

  1. It doesn't trigger the "stop" message immediately after you let go.
  2. Instead, if continues spamming a period every tick until the golden apple's use duration elapses, and only then does it say "stop".
  3. You consume the golden apple, even though you weren't holding the Use Item button. You start seeing regeneration particles and the absorption effect on your health bar.
  4. Even as you're consuming the golden apple, your walking speed is not reduced as it normally is while eating food. You can also sprint during this time which isn't normally the case for food. The eating animation also does not play.

Expected Results:

Letting go of the Use Item button before the apple is consumed should:

  1. Immediately stop spamming periods and say "stop" in chat
  2. It should not consume the apple, nor apply its effects.

Regression Build:

Worked in 1.20.50.03, doesn't work in 1.20.60.26_rc0

Screenshots / Videos Attached:

Yes. In both of the videos I am only tapping the Use Item button, not holding it down. I shouldn't be consuming the golden apples.

Notes

Possibly related MCPE bug: MCPE-177817

Unresolved

Energyxxer

2024-02-22, 12:42 AM

2024-03-04, 04:01 PM

1

1

-

-