Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Tags
Creators
Details
⚠️ This is an unofficial fork of Jail Logic by n3mmuss.
The original project appears inactive, so this fork exists to keep the mod usable on newer Minecraft versions, with some optional improvements.
The original project’s source code is released under the CC0 license.
This fork is redistributed under the MIT License to clearly define attribution and contribution terms for future maintenance.
If the original author releases updates for the versions this fork targets and includes the fixes provided here, this fork will no longer be updated.
Please do not report issues to the original developer. Report them here instead.
Jail Mod (Fabric)
The Jail Mod is a server-side mod that allows you to imprison players in a virtual prison, preventing them from interacting with the world until they are released. It is perfect for Minecraft servers where you want to impose temporary penalties or temporarily limit the movement of certain players.

Key Features
- Temporary Imprisonment: You can imprison a player for a specific amount of time, blocking interactions with blocks, entities, and objects, such as buckets of lava or water.

- Automatic or Manual Release: The player is automatically released after the set time, or an admin can release them manually.
- Imprisonment Reason: Add a reason when needed. If omitted, it defaults to
Unknown reason.
- Command to know the remaining time: Imprisoned players can check the time remaining until their release.

- BanHammer-style jail messages: Player names are red, staff names gold, and reasons and durations yellow. Jail announcements include the reason and sentence duration.
- Discord Webhook (optional): Sends jail and unjail events to a Discord webhook. If BanHammer is installed and Jail Mod webhook is empty, Jail Mod reuses BanHammer's webhook automatically.
- BanHammer-style Discord templates: Supports
config/jailmod/discord-messages.jsonin BanHammer-like format with auto patching for new fields.
How to use:
-
Build a prison (a closed structure).
-
Set the coordinates where you want the prisoner to spawn with the command
/jail set x y z(example/jail set 0 60 0) -
Reload the configuration using
/jail reload. -
Send someone to jail with a duration and optional reason, for example
/jail imprison playerexample 2m Griefing. If you omit the reason, it will beUnknown reason. -
Release a player early with
/unjail playerexampleif needed.
Requirements
- Minecraft 26.3
- Java 25
- Fabric Loader
- Fabric API
Installation
- Place the mod's
.jarfile in themodsfolder of the Minecraft server. - Start the server to generate configuration files.
Available Commands
1. /jail imprison player duration [reason]
- Description: Jails a player for the specified duration. The reason is optional and defaults to
Unknown reason. - Who can use it: Only admins or server operators.
- Syntax:
/jail imprison player_name duration [reason] - Duration units:
s,m,h,d,w/wk,mo/mth,y/yr, plusweek(s)andyear(s). Full names such assecond(s),minute(s),hour(s),day(s), andmonth(s)are also accepted. Units attach directly to the number (for example,10seconds). A bare number or unknown suffix is treated as seconds. Months are 30 days and years are 365 days. - Examples:
/jail imprison Steve 300 Griefing,/jail imprison Steve 10m, and/jail imprison Steve 2years Breaking blocks. The second example uses the default reason.
2. /unjail player
- Description: Manually releases a player from jail before the time expires.
- Who can use it: Only admins or server operators.
- Syntax:
/unjail player_name - Example: /unjail Steve
This command will manually releaseStevefrom jail.
3. /jail info
- Description: Allows incarcerated players to see the time remaining until release and the reason for their incarceration.
- Who can use it: Only jailed players.
- Example:
/jail infoShows the remaining duration in nonzero units, who jailed the player, and the reason; for example: "You are jailed for 10 minutes by Alex. Reason: Griefing."
4. /jail reload
- Description: Reloads configuration, language messages, and
discord-messages.jsonwithout restarting the server. - Who can use it: Only admins or server operators.
- Example:
/jail reloadThis command reloads the mod's configuration, useful if the config files have been modified.
5. /jail set
- Description: Sets the coordinates where jailed players will spawn. This is where players will appear when they are sent to jail.
- Who can use it: Only admins or server operators.
- Syntax:
/jail set x y z - Example:
/jail set 0 60 0
This command sets the jail spawn location to coordinates (0, 60, 0).
Interactions blocked during jail
When a player is jailed, they cannot do the following:
- Use blocks, such as doors, levers, or buttons.
- Interact with entities, such as villagers or animals.
- Use lava or water buckets.
- Break or place blocks.
Automatic release
- Players will be automatically released from jail when the set time is up.
- While jailed, players can check the remaining time using the
/jail infocommand.
Configuration file
config/jailmod/config.json
This file is automatically generated and updated, it allows you to configure the jail's location and the player's release location and more. Here are the options you can find:
admin_roles: Comma-separated list of roles or tags that grant /jail access. e.g. "op,admin,moderator"use_previous_position: If set totrue, players will be released in the position they were in before being jailed. If set tofalse, they will be released in a specific position.return_to_last_location: If true, released players will be teleported back to the exact spot where they were jailed.release_position: The fallback coordinates for releasing players if no other location (spawn/last) is used, active ifuse_previous_positionis set tofalseor ifreturn_to_last_locationis set tofalse.jail_position: The coordinates where players are held while in jail with coordinatesx,y,z.discord_webhook_url: Optional Discord webhook used for jail/un-jail embeds. Leave empty to auto-use BanHammer's webhook when BanHammer is installed and has a webhook url set (read fromconfig/banhammer/config.json).use_banhammer_webhook: Iftrueanddiscord_webhook_urlis empty, JailMod may reuse BanHammer's webhook URL.
Example configuration:
{
"_config_guide": "JailMod Configuration Guide: \n- admin_roles: Comma-separated list of roles or tags that grant /jail access. Use \u0027op\u0027 to include server operators.\n- use_previous_position: If true, released players will be teleported to their original spawn point (if return_to_last_location is false or unavailable).\n- return_to_last_location: If true, released players will be teleported back to the exact spot where they were jailed.\n- jail_position: The coordinates where players are held while in jail.\n- release_position: The fallback coordinates for releasing players if no other location (spawn/last) is used.",
"admin_roles": "op",
"use_previous_position": true,
"return_to_last_location": true,
"discord_webhook_url": "",
"use_banhammer_webhook": true,
"release_position": {
"x": 100,
"y": 65,
"z": 100
},
"jail_position": {
"x": 20,
"y": 64,
"z": 142
}
}
config/jailmod/discord-messages.json
This file controls Discord webhook message templates in a BanHammer-style format and is auto-generated/auto-patched.
sendJailMessage: Enables jail webhook notifications.jailMessage: Template for jail events.sendUnjailMessageandunjailMessage: Template for manual unjail events.sendAutoUnjailMessageandautoUnjailMessage: Template for auto unjail events.
/jail reload reloads this file too.
config/jailmod/language.txt
This file contains the messages that are displayed in-game, customizable to match the tone or style of the server. If the file does not exist, it is automatically generated with default messages. Here are some of the messages you can modify:
jail_player: Message the player receives when they are jailed. Use{time},{reason}, and{actor}placeholders. Example:"You have been jailed by {actor} for {time}! Reason: {reason}"jail_broadcast: BanHammer-style public jail announcement.{player}is red,{actor}gold,{reason}and{time}yellow, and other text white. Example:"Player: {player} has been jailed by {actor}! Reason: {reason}. Expires in {time}"unjail_player_manual: Message the player receives when they are manually released from jail.
Example:"You have been manually released from jail!"unjail_broadcast_manual: Message broadcast to all players on the server when a player is manually released from jail.
Example:"{player} has been manually released from jail!"unjail_player_auto: Message the player receives when they are automatically released from jail after the time expires.
Example:"You have been released after serving your sentence."unjail_broadcast_auto: Message broadcast to all players on the server when a player is automatically released from jail after the time expires.
Example:"{player} has been released after serving their sentence."block_interaction_denied: Message informing the player that they cannot interact with blocks while in jail.
Example:"You cannot interact with blocks while in jail!"entity_interaction_denied: Message informing the player that they cannot interact with entities while in jail.
Example:"You cannot interact with entities while in jail!"bucket_use_denied: Message informing the player that they cannot use lava or water buckets while in jail.
Example:"You cannot use lava or water buckets while in jail!"item_use_denied: Message informing the player that they cannot use items while in jail.
Example:"You cannot use items while in jail!"block_break_denied: Message informing the player that they cannot break blocks while in jail.
Example:"You cannot break blocks while in jail!"jail_time_added_playerandjail_time_added_broadcast: Messages for added jail time.{added}and{time}are formatted durations, so do not add unit labels after them.jail_info_message: Message shown by/jail info.{time}contains only nonzero years, months, days, hours, minutes, and seconds;{actor}is who jailed or most recently extended the sentence;{reason}is the reason. Example:"You are jailed for {time} by {actor}. Reason: {reason}"not_in_jail_message: Message shown if a player is not in jail and tries to use/jail info.
Example:"You are not in jail!"
Default language.txt example:
jail_player=You have been jailed by {actor} for {time}! Reason: {reason}
jail_broadcast=Player: {player} has been jailed by {actor}! Reason: {reason}. Expires in {time}
unjail_player_manual=You have been manually released from jail!
unjail_broadcast_manual={player} has been manually released from jail!
unjail_player_auto=You have been released after serving your sentence.
unjail_broadcast_auto={player} has been released after serving their sentence.
block_interaction_denied=You cannot interact with blocks while in jail!
entity_interaction_denied=You cannot interact with entities while in jail!
bucket_use_denied=You cannot use lava or water buckets while in jail!
item_use_denied=You cannot use items while in jail!
block_break_denied=You cannot break blocks while in jail!
jail_time_added_player=Your jail time has been extended by {actor}. Added {added}. Remaining: {time}. Reason: {reason}
jail_time_added_broadcast={player}'s jail time has been extended by {actor}. Added {added}. Remaining: {time}. Reason: {reason}
jail_info_message=You are jailed for {time} by {actor}. Reason: {reason}
not_in_jail_message=You are not in jail!
Usage Tips
Use /jail reload after changing configuration or language messages. Add a clear reason when needed; if omitted, it defaults to Unknown reason. Older language files are updated automatically, and unit labels after {time} or {added} are removed during migration.
Usage Examples
Set Jail spawn position:
/jail set 0 60 0
Jailing a player for an unfair action:
/jail imprison Alex 600 Offending another player
This jails Alex for 10 minutes with the reason "Offending another player".
Checking jail time:
/jail info
A jailed player can use this command to check how much time they have left.


