Appears randomly; by default, the chance is about once every 10 minutes per player. Creative and Spectator modes are not affected. Can be triggered with the command /jumpscare [players] (requires operator permissions, level 2).
First image (1 sec). It appears in random locations on the screen, changing position every 2 ticks, and moves toward the center while growing larger. The screen flashes red during this time.
Window 1.5 sec. If the player presses W, A, S, D, or the spacebar, a second image appears in the center. It enlarges for 1 second, and the player takes 3 hearts of damage.
Damage. The damage type is “magic”; it ignores armor. The client detects key presses and sends a packet to the server. The server checks that the window is still open and deals the damage itself.
Translated with DeepL.com (free version)

