kangarko / ChatControl-Pro

The ultimate chat solution. Prevent spam, ads, swears and even bots on your server. Replaced by ChatControl Red: https://mineacademy.org/chatcontrol-red
Other
65 stars 8 forks source link

1.16.5, How can i make sound in general for the chat? #2273

Closed download042 closed 3 years ago

download042 commented 3 years ago

What i need: When a players sends a text, with any rank, its playing a sound for erveryone. Just like the config option to play a sound when you get mentioned in chet by somebody. Any idea how to make it?

download042 commented 3 years ago

Obviously without the sound, when the message got caught by swear rules, so the chat message got blocked from appearing

TheIntolerant commented 3 years ago

EDITED

To do that but not have a sound play when a swear rule is triggered, add the following to the bottom of the list in your rules.txt file.

# Sends a sound to all players when a message in chat is sent.
match (.)*
ignore event commands|signs|book|item
then console execute at @a run playsound minecraft:entity.arrow.hit_player ambient @a
ignore perm chatcontrol.bypass.chatsound
dont verbose

IF then console execute at @a run playsound minecraft:entity.arrow.hit_player ambient @a doesn't work try then sound ENTITY_ARROW_HIT_PLAYER, 1.0, 0.1

FYI, I added the ignore perm in case you wanted to create a bypass for your staff etc. If you don't want that, just remove it from the chatcontrol rule, also that perm can be whatever you wish.

I haven't tried this before so I am not 100% sure if that will work but I see no reason for it not to work, especially if you can get people to hear a sound via a command. In which case you would just use that for the then console section to run that command.

kangarko commented 3 years ago

Thanks to gone incognito for the tip!