SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.07k stars 368 forks source link

Suggestion: "chat visibility" expression #2270

Open aeonlamb opened 5 years ago

aeonlamb commented 5 years ago

Description

Having an expression that indicates the chat visibility setting of a player would be very useful. The "chat visibility" setting is found in options > chat settings in the minecraft client. There's three possible settings: "Shown", "Commands only", and "hidden".

Context

My biggest and most expansive script is a custom chat system I've developed, which intercepts the "on chat" event and substitutes ordinary chat messages with custom formatted ones that are sent with the "send" effect.

It actually works quite well, but one small quirk of this design choice is that chat messages are still shown to the player even if they've set their chat setting to "commands only", which shouldn't be the case. I have no way of detecting a player's chat visibility settings, so being able to do that would help fix this problem for me. Thank you!

Blueyescat commented 5 years ago

Even if the client sends an info to the server when changing the chat settings, it is not supported by Spigot or Paper. So no

There is a way to manage chat messages that is sent by the server using packets (with addons), you should ask in Discord servers.

aeonlamb commented 5 years ago

I believe that this information is actually sent to the server. I didn't know there was no spigot api for it, though.

TheLimeGlass commented 5 years ago

What Blueyescat means is that the only way to access this setting is through packets and reflection. Sure Skript could access it and read from it, but Skript has set rules in which it does not support reflection of any kinds, for stress of updating it and doing protocol engineering each update.

aeonlamb commented 4 years ago

Paper recently added an API for this here: (x). Is there any chance this could be looked into now?

Pikachu920 commented 4 years ago

sure, but just so you know there's still no set support only get.