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 also works in singleplayer worlds, where the host can use jail commands when commands are enabled.

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.
- Jail list: Staff can view jailed players, their remaining time, reason, and who jailed them with
/jail list. - Offline release: Release offline players by name or UUID. Their jail status is cleared immediately, and their saved state is restored when they next join.
- Discord Webhook (optional): Sends jail and unjail events to a Discord webhook. BanHammer webhook reuse defaults to enabled on dedicated servers and disabled in client/singleplayer defaults.
- BanHammer-style Discord templates: Supports
config/jailmod/discord-messages.jsonin BanHammer-like format with auto patching for new fields. - Mod Menu settings and help: Edit client defaults and per-world overrides for admin roles, jail and release positions, and Discord options. Open the config files or search the built-in Help tab when Mod Menu and Cloth Config are installed.
How to use:
-
Build a prison (a closed structure).
-
Set the jail position with
/jail set x y z(example/jail set 0 60 0) or stand at the desired block and run/jail set. -
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
/jail unjail playerexampleor/unjail playerexample. You can also use a player's UUID; offline players are released when they next join.
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. For singleplayer, install the mod in the Minecraft instance's
modsfolder. Mod Menu and Cloth Config are optional and enable the in-game settings screen.
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, plus pluralwks/yrsand full namessecond(s),minute(s),hour(s),day(s),week(s),month(s), andyear(s). 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. /jail unjail <player name|UUID>
- Description: Manually releases a jailed player before the time expires. Targets can be online or offline and may be specified by name or UUID. Offline players have their saved state restored when they next join.
- Who can use it: Only admins or server operators.
- Syntax:
/jail unjail <player_name|uuid> - Alias:
/unjail <player_name|uuid> - Examples:
/jail unjail Steveor/jail unjail 069a79f4-44e9-4726-a5be-fca90e38aaf5
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 list
- Description: Lists jailed players with their remaining sentence, reason, and the staff member who jailed them. Offline jailed players are included.
- Who can use it: Only admins or server operators.
- Example:
/jail list
5. /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.
6. /jail set
- Description: Sets where jailed players will spawn. With no coordinates, it uses the executing player's current block position.
- Who can use it: Operators can always use it. Configured admin-role tags can use it when
allow_admin_role_set_jail_positionis enabled. - Syntax:
/jail setor/jail set x y z - Examples:
/jail setuses your current block position;/jail set 0 60 0sets the position explicitly. Console users must provide coordinates.
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. On a dedicated server, it is that server's active configuration. In singleplayer, it stores the client defaults used for new worlds; each world can have separate overrides in its serverconfig/jailmod/config.json file. Mod Menu shows Client Defaults and This World settings separately, and disables world settings when no world is open. The config screen also has buttons to open the relevant config file and a searchable Help tab. Jail records are stored per world in serverconfig/jailmod/jail_data.json; dedicated servers use config/jailmod/jail_data.json.
admin_roles: Comma-separated list of tags that grant admin command access, e.g.admin,moderator.oprepresents server operators.allow_admin_role_set_jail_position: Defaults tofalse. When enabled, configured admin-role tags can use/jail set; operators can always use it.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 use BanHammer's webhook when enabled in the world's settings.use_banhammer_webhook: Iftrueanddiscord_webhook_urlis empty, Jail Mod may reuse BanHammer's server-side webhook. It defaults totrueon dedicated servers andfalsein client/singleplayer defaults. It is not exposed in the Mod Menu screen.
Example configuration:
This example is for a dedicated server. Client/singleplayer defaults use false for use_banhammer_webhook.
{
"_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",
"allow_admin_role_set_jail_position": false,
"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.


