How to add words

Adding words ingame or via console

There are two ways of adding words to censor.
The first method is to use the ingame command. To add a word ingame or via console you have to use the command:
/censor add <word> <replace> <action> [method] [penalty-points:damage]

ParameterDescription
<word>The word to censorrequired
<replace>The word to replace the censored word withrequired
<action>The action to perform. Can be: NONE, KICK, BAN, TEMPBANrequired
[method]The method to use to replace the word. There are several methods: default, alternative, compact. See below to find out which method to use.optional (default method is default)
[penalty-points:damage]The penalty-points to add to the player and the damage to deal to the playeroptional (default is 0:0)

These are some examples on how to use this command:

  • /censor add word anotherword TEMPBAN
  • /censor add word anotherword KICK compact
  • /censor add word anotherword NONE alternative 1:0
  • /censor add word anotherword NONE default 2:5

Adding words in server files

Words also can be added out of the game in the server files. To do that make sure your server is shut down! You can find all the files words are saved in via the path: root/plugins/CensorShip/words. Open one of the files and start adding a new word. The format for a new word is:

  {
      "word": "word",
      "replace_with": "anotherword",
      "action": "none",
      "method": "default",
      "damage": 0,
      "penalty_points": 0,
      "exceptions": [
. . . . ."wordy",
. . . . ."wordery"
. . . ],
      "commands": [
. . . . ."msg <player> don't do this again!", 
. . . . ."tp <player> 0 256 0"
. . . ]
  }
ParameterDescription
wordThe word to be censored
replace_withThe word to replace the word to censor with
actionThe action to perform. Can be: NONE, KICK, BAN, TEMPBAN
methodThe method to use to replace the word. There are several methods: default, alternative, compact. See below to find out which method to use.
damageThe damage to deal to the player for using that word
penalty_pointsThe penalty-points to add to the player for using that word
exceptionsA list of exceptions which contain the word but should not be replaced
commandsA list of commands to perform when using that word

When there are multiple words in this file, seperate the blocks with a comma, like this:

  {
      "word": "word",
      "replace_with": "anotherword",
      "action": "none",
      "method": "default",
      "damage": 0,
      "penalty_points": 0,
      "exceptions": [],
      "commands": []
  },
  {
      "word": "anotherword",
      "replace_with": "word",
      "action": "ban",
      "method": "default",
      "damage": 5,
      "penalty_points": 1,
      "exceptions": [],
      "commands": []
  }

If you want to create a new file for your words, you can add another json file in the same folder. Add this structure to your file:

{
  "words": []
}


Add your new words inbetween the [] brackets.

Now that your file is created you have to let the plugin know that this file exists. To do that go to: root/plugins/CensorShip/ and open worlds-config.json. In there just add another line with your files name (without the .json expansion!).

Methods to censor

I implemented the methods to censor to add the possibility to censor the word in the way you want it to be censored. For example, for "who removed this?" there are several ways on how to replace the word "whore".
You could replace is so "<replaced word> moved this?" comes out but you also could use a method so the original phrase stays the same (what you probably want in this case). But using this also has some bad points. No word can be censored correctly all of the time, but using the correct methods they do most of the time. To test a word with a certain method, you can use following command:
/censor test <method> <word> <message>

This command searches for the all forms of the given word in the given message using the given method and replaces them like the plugin would to ingame. So you can test several situations with different methods and messages to find out, which one fits best for your needs.


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes