Skip to content

Whitelisted words DISABLE swearing #95

@SpyCoderX

Description

@SpyCoderX

Spark link

No response

Plugin Version

1.21.4-225-main@0767902 (2025-04-11T21:49:39Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Server Version

1.21.4

Server Platform

Paper

Describe the bug

By putting a word which is included in the "whitelist" section of the bannedwords.yml file in your chat message, it disables all swearing checks.

This allows for complete bypassing of the swearing filter.

Steps to reproduce

  1. Locate a word included in whitelist in the bannedwords.yml file (default is "an alt").
  2. Make sure to enable swearing checks. It doesn't matter if increased sensitivity is enabled.
  3. Simply send a chat message containing any swear words and include the whitelisted word somewhere in there.

Additional context

This is caused by the code in ListenerSwear.java at lines 50 and 68:

if (message.contains(allowed.toLowerCase())) return;

This disables checking for swear words in a chat message when that message contains a whitelisted (allowed) word.

The fix is to compare the number of occurrences of a whitelisted word with the occurrences of the bad words it contains. If there are more bad words then the whitelisted word, the message has swearing.
Example:

  • Say "apple" was a bad word, but "applepie" was a whitelisted word.
  • In the message "I want some applepie", there is 1 mention of 'apple' and 1 mention of 'applepie'. Since they are equal, they cancel out and there is no swearing.
  • In the message "I want an apple and applepie", there is 2 mentions of 'apple' but only 1 mention of 'appliepie'. This means there is swearing.

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I ticked all the boxes without actually reading them
  • My version of Minecraft is supported by CrazyCrew.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions