Event when a player opens the chat

Hi!

Does an event exist for when a player opens his chat?

Hello,

you can find a list of all events (for SpongeAPI 7.1.0) here. To answer, opening the chat is a client-side action, it means no event exists.

Ok, thanks. I asked because I saw a PlayerChangeClientSettingsEvent. Maybe you can help me find a solution to my problem. I would like to put the player in invincible mode when he is writing. I would like to do this without using a mod. Is there a way to do this? Is yes, how?

Unfortunately, no. Minecraft doesn’t tell the server when the chat is open.

beat me to it :smiley:

Thanks anyway! Last try: is there a way to catch en event when a player uses key on his keyboard?

No such event…
The client only notifies the Server about chatting when you either send the text (press enter), or use tab-auto-completion on some command-argument

Ok. Thanks a lot! I think I will create a mod to solve my problem, if the is no other solution.

Maybe make the player invincible when he’s not moving for like 5 seconds.

Just to point out: The tab completion bit may no longer be valid come 1.14, as Minecraft command system moves over to brigadier.