Event when a player opens the chat


#1

Hi!

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


#2

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.


#3

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?


#4

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


#5

beat me to it :smiley:


#6

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


#7

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


#8

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


#10

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


#11

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