A simple Fabric mod for Minecraft that adds mandatory password authentication to your server, enhancing security.
- Password Protection: Players must set a password on their first join and log in on subsequent joins.
- Interaction Blocking: Prevents unauthenticated players from breaking/placing blocks, using items/entities, or interacting with the world.
- Command Restriction: Blocks all commands except
/loginand/setpassworduntil the player is authenticated. - Secure Storage: Passwords are securely hashed (SHA-256) and stored in a JSON file (
config/safeserver/passwords.json). - OP Safety:
- Temporarily removes OP status from players upon joining until they authenticate.
- Removes OP status from players upon disconnecting as a safety measure.
- Restores OP status after successful authentication if the player was originally OP.
- Position Freeze & Safety: Players are placed in Spectator mode and teleported to a safe, fixed location (0, calculated surface Y, 0) upon joining if authentication is needed. They are kept at this location until authenticated, preventing coordinate leakage. Their original position is restored upon successful login.
/setpassword <password> <password>- Sets your initial password upon first joining the server.
- Requires typing the password twice for confirmation.
- Only usable when required (first join).
/login <password>- Logs you into the server with your existing password.
- Only usable when required (subsequent joins).
/changepassword <oldPassword> <newPassword> <newPassword>- Allows an authenticated player to change their own password.
- Requires the old password and confirmation of the new password.
/resetpassword <playerName>- OP Only (Level 2+): Resets the password for the specified player.
- Forces the target player to set a new password using
/setpasswordon their next join (or immediately if they are currently online).
- Ensure you have Fabric Loader installed.
- Download the Safeserver JAR whose
+mc<version>suffix exactly matches your server. - Place the JAR file into your server's
modsfolder. - Restart your server.
The mod will automatically generate the necessary configuration file upon first load.
Every stable Java Edition release after 1.20 is built and verified independently:
1.20.1 through 1.20.6, 1.21 through 1.21.11, and 26.1 through 26.2.
Each artifact targets one exact Minecraft version. For example, safeserver-2.1.3+mc1.20.1.jar is the 1.20.1 artifact. This avoids claiming binary compatibility across versions that have different server APIs.
The repository uses Stonecutter with Mojang mappings. The files under src/ are the canonical 26.2 source; Stonecutter's //? conditions contain only the API differences required by older versions.
Build commands:
./gradlew :26.2:buildbuilds the active development target../gradlew :1.20.1:buildbuilds one older target../gradlew buildAllbuilds all 22 supported targets../gradlew collectArtifactsbuilds all targets and writes release and sources JARs tobuild/releases/<mod-version>/.
When adding a feature, implement it once in src/. If a Minecraft API differs, add the smallest possible Stonecutter condition and run ./gradlew collectArtifacts. CI runs this same aggregate build for every push and pull request, so a feature cannot be merged while any supported target fails to compile.
To add a future Minecraft release:
- Add the version to
settings.gradle.kts. - Add its pinned Fabric API version to
stonecutter.properties.toml. - Add compatibility conditions only where the new Minecraft API requires them.
- Run
./gradlew collectArtifactsbefore committing.
Publishing creates one Modrinth release containing the version-qualified JARs for every supported Minecraft release. Modrinth applies compatibility metadata to the release as a whole, so choose the file whose +mc<version> suffix exactly matches your server.
Local dry run:
printf '%s\n' 'Release notes' > .release-changelog.md
./gradlew collectArtifacts
scripts/publish_modrinth.sh --changelog-file .release-changelog.md --dry-runLocal release:
export MODRINTH_TOKEN=your_token_here
./gradlew collectArtifacts
scripts/publish_modrinth.sh --changelog-file .release-changelog.mdFor GitHub Actions, add a MODRINTH_TOKEN repository secret with Modrinth version read/create/write/delete permissions. Set mod.version in stonecutter.properties.toml, push a matching tag such as v2.1.3, and .github/workflows/release-modrinth.yml will build and publish one release containing all targets. Republishing the same mod version safely replaces its existing combined or per-Minecraft releases.