The flashing of the glass bottle also allows you to fill the glass bottle with water, in turn fully preventing the teacup from appearing in your mainhand.
This part of the bug may be able to be fixed by adding water bottles to the possible items that can be replaced by the teacup... but that also might cause more issues.
It might not even be possible to fix the flashing itself, however. This is due to weird Mojangy tick order. The order is as such;
- Tea drinking advancement triggered
- Mainhand replaced with glass bottle
/schedule
triggers or inventory_changed
advancement triggers
The small gap between the first and last steps in this order is what causes the bug. There's always going to be a small gap of one tick, unless there's some way other than /schedule
or inventory_changed
to trigger the replacement slightly earlier.