Adding a server code of conduct (Minecraft: Java Edition)

If you run a public server, it is recommended to add a code of conduct. A code of conduct allows you to inform your players about the rules of your server before they start playing. It can be enabled in Minecraft: Java Edition 1.21.9+ and be made available in multiple languages.

java

Minecraft allows setting a code of conduct for your server that is shown to players when they first join your server. Only if a player acknowledges your code of conduct, they are allowed to play.

Code of conduct dialog in Minecraft showing example text

Writing a good code of conduct

While you can generally write your code of conduct however you like and however fits your server, you can use the following tips to make it as effective as possible:

  • Keep it clear and simple
    Use straightforward language. Players of all ages should understand the rules without confusion.
  • Be specific, but not overly strict
    Define what not to do (e.g. griefing, hacking), but don't try to list every possible offense. Leave room for staff judgment.
  • Match the rules to your server type
    PvP servers need different rules than Creative or Roleplay ones. Tailor your rules to the gameplay and community style.
  • Set the tone you want
    The way you write your rules sets the mood. Friendly, fair, and respectful wording encourages the same behavior.
  • Explain why rules exist
    Briefly stating the reason behind a rule (e.g. "No griefing - we want a safe space to build") makes players more likely to respect it.
  • Be transparent about enforcement
    Let players know what happens if rules are broken (e.g. warnings, temp bans). Consistency builds trust.
  • Keep it short and organized
    Too many rules can overwhelm players. Stick to the essentials and use headers, bullets, or numbers for easy reading.

Adding your code of conduct to your server

Create the code of conduct folder

Your server looks for code of conduct files in a folder called codeofconduct inside your main server folder. To create it, open the Files page, click the New Folder button, enter codeofconduct as the folder name and confirm.

Click the "New Folder" button and enter "codeofconduct" as the folder name

Add code of conduct files

All code of conduct files are text files inside the codeofconduct folder. They are named in the format <language_code>.txt, where <language_code> is the code of the language the text is written in.

When a player joins, Minecraft first looks for a code of conduct in the language the player currently uses. If that language is not available, English (en_us) is used. If there is no English text either, the first available text in any language is used.

Which languages you translate your code of conduct to is up to you, but there needs to be at least one language, and there should be an English version as a fallback.

Inside the codeofconduct folder, click the New File button and enter the file name, for example en_us.txt.

Click "New File" and enter "<language_code>.txt" (e.g. "en_us.txt") as the file name

Then click the file to open it in the file editor, add your code of conduct text and save it.

Click the file to edit it, and enter your code of conduct text

Enable the code of conduct

After adding your code of conduct, enable the Code of conduct option in the Options of your server or in your server.properties file.

"Code of conduct" server option enabled

Restart your server

After starting or restarting your server, players are shown your code of conduct when they connect to your server.