ModsJava
Prevent Block
Java mod listed for Minecraft 1.21–26.x. Downloads from the MC Java Mods app on Android.
PREVENT BLOCK Advanced Block Break & Place Protection with Developer API Native Version: Paper 1.21.1 (Java 21) ✦ OVERVIEW ✦ PreventBlock is a modern…
⬇ Download on SpigotPREVENTBLOCK
Advanced Block Break & Place Protection with Developer API
Native Version: Paper 1.21.1 (Java 21)
PreventBlock is a modern, lightweight, and high-performance block protection plugin tailored for Paper 1.21.1. It grants server owners complete authority over block manipulation with independent Whitelist and Blacklist modes, fluid bucket safety, actionbar alerts, cooldown anti-spam, and a complete Developer API.
Whether you are configuring an SMP, Prison, RPG server, or custom minigame, PreventBlock handles all block restrictions smoothly with zero performance impact.
✦ KEY FEATURES ✦
- Dual Whitelist & Blacklist Modes: Configure breaking and placing rules completely independently.
- Fluid & Bucket Protection: Intercepts bucket emptying (Water, Lava, Powder Snow, Fish Buckets) and fluid picking.
- Smart Notifications: Send alerts via Actionbar (recommended) or Chat.
- Anti-Spam Cooldown: Built-in configurable cooldown stops chat and sound spam when players click repeatedly.
- Modern Colors: Full support for MiniMessage formatting (<red>, <gradient>, <bold>) alongside legacy color codes (&c, &a).
- Custom Sound Alerts: Plays warning sound effects (configurable sound, volume, pitch) when an action is blocked.
- Per-Player Overrides: Grant specific players special permissions to break or place restricted blocks without modifying global config.
- Persistent Data: Custom player overrides automatically save and persist across server restarts via overrides.yml.
- Admin Bypass Toggle: Admins can quickly toggle bypass on the fly via /pb bypass [player].
- Developer API: Deep integration for other plugins via registered service, custom validators, and events.
Main Command: /preventblock (Alias: /pb)
Admin Permission: preventblock.admin
- /pb help - Show all available commands.
- /pb status - View active modes, loaded blocks count, and status.
- /pb reload - Reload config.yml and overrides.yml.
- /pb mode <break|place> <whitelist|blacklist> - Change filter mode dynamically.
- /pb list <break|place> - List all configured blocks.
- /pb add <break|place> <material> - Add a block material to the list.
- /pb remove <break|place> <material> - Remove a block material from the list.
- /pb check <break|place> [player] <material> - Check if an action is permitted.
- /pb bypass [player] - Toggle runtime bypass for yourself or another player.
- /pb player <player> list - View custom overrides for a player.
- /pb player <player> clear - Clear all overrides for a player.
- /pb player <player> override <break|place> <material> <allow|deny|clear> - Set individual player override.
- preventblock.admin - Access to all PreventBlock commands (Default: OP).
- preventblock.bypass - Bypass all block break and place restrictions (Default: OP).
- preventblock.break.<material> - Per-block break permission (when use-permissions is true).
- preventblock.place.<material> - Per-block place permission (when use-permissions is true).
Spoiler: Click to view config.yml
# =======================================================
# PREVENTBLOCK CONFIGURATION
# Designed for Paper Minecraft 1.21.1
# =======================================================
settings :
# Permission node to bypass all restrictions
bypass-permission : "preventblock.bypass"
# Prevent bucket dumping/filling (Water, Lava, Powder Snow, etc.)
check-buckets : true
# Optional per-block permissions (e.g. preventblock.break.stone)
use-permissions : false
# Notification settings when an action is blocked
notifications :
# Master switch for all notifications and sounds
enabled : true
# Send message to Actionbar (recommended to avoid chat clutter)
send-actionbar : true
# Send message to Chat
send-chat : false
# Delay in milliseconds between warning messages to prevent spam
cooldown-ms : 1000
# Warning sound played to the player
sound:
enabled : true
name : "ENTITY_VILLAGER_NO"
volume : 1.0
pitch : 1.0
# Customizable messages (supports MiniMessage and & color codes)
# Placeholders: <player>, <block>, <action>
messages:
prefix : "<dark_gray>[<gradient:#ff5555:#ffaa00>PreventBlock</gradient>]</dark_gray> "
break-denied : "<red>You are not allowed to break <yellow><block></yellow>!"
place-denied : "<red>You are not allowed to place <yellow><block></yellow>!"
no-permission : "<red>You do not have permission to execute this command!"
reload-success : "<green>PreventBlock configuration reloaded successfully!"
rules :
# Block Breaking Rules
break :
# WHITELIST: Only blocks in this list can be broken.
# BLACKLIST: All blocks can be broken except those in this list.
mode : "BLACKLIST"
blocks :
- "BEDROCK"
- "BARRIER"
- "STRUCTURE_BLOCK"
- "COMMAND_BLOCK"
- "CHAIN_COMMAND_BLOCK"
- "REPEATING_COMMAND_BLOCK"
# Block Placing Rules
place :
# WHITELIST: Only blocks in this list can be placed.
# BLACKLIST: All blocks can be placed except those in this list.
mode : "BLACKLIST"
blocks :
- "BEDROCK"
- "BARRIER"
- "STRUCTURE_BLOCK"
- "COMMAND_BLOCK"
- "CHAIN_COMMAND_BLOCK"
- "REPEATING_COMMAND_BLOCK"
- "TNT"
✦ DEVELOPER API ✦
Code (YAML):
# =======================================================
# PREVENTBLOCK CONFIGURATION
# Designed for Paper Minecraft 1.21.1
# =======================================================
settings :
# Permission node to bypass all restrictions
bypass-permission : "preventblock.bypass"
# Prevent bucket dumping/filling (Water, Lava, Powder Snow, etc.)
check-buckets : true
# Optional per-block permissions (e.g. preventblock.break.stone)
use-permissions : false
# Notification settings when an action is blocked
notifications :
# Master switch for all notifications and sounds
enabled : true
# Send message to Actionbar (recommended to avoid chat clutter)
send-actionbar : true
# Send message to Chat
send-chat : false
# Delay in milliseconds between warning messages to prevent spam
cooldown-ms : 1000
# Warning sound played to the player
sound:
enabled : true
name : "ENTITY_VILLAGER_NO"
volume : 1.0
pitch : 1.0
# Customizable messages (supports MiniMessage and & color codes)
# Placeholders: <player>, <block>, <action>
messages:
prefix : "<dark_gray>[<gradient:#ff5555:#ffaa00>PreventBlock</gradient>]</dark_gray> "
break-denied : "<red>You are not allowed to break <yellow><block></yellow>!"
place-denied : "<red>You are not allowed to place <yellow><block></yellow>!"
no-permission : "<red>You do not have permission to execute this command!"
reload-success : "<green>PreventBlock configuration reloaded successfully!"
rules :
# Block Breaking Rules
break :
# WHITELIST: Only blocks in this list can be broken.
# BLACKLIST: All blocks can be broken except those in this list.
mode : "BLACKLIST"
blocks :
- "BEDROCK"
- "BARRIER"
- "STRUCTURE_BLOCK"
- "COMMAND_BLOCK"
- "CHAIN_COMMAND_BLOCK"
- "REPEATING_COMMAND_BLOCK"
# Block Placing Rules
place :
# WHITELIST: Only blocks in this list can be placed.
# BLACKLIST: All blocks can be placed except those in this list.
mode : "BLACKLIST"
blocks :
- "BEDROCK"
- "BARRIER"
- "STRUCTURE_BLOCK"
- "COMMAND_BLOCK"
- "CHAIN_COMMAND_BLOCK"
- "REPEATING_COMMAND_BLOCK"
- "TNT"
Spoiler: Click to view Developer API Examples
✦ INSTALLATION ✦
1. Obtaining the API Instance:
import com.polarism.preventblock.api.PreventBlockAPI ;
PreventBlockAPI api = PreventBlockAPI. get ( ) ;
2. Checking Block Access:
Player player = ... ;
Block block = ... ;
if (api. canBreak (player, block ) ) {
// Player is allowed to break this block
}
if (api. canPlace (player, block, Material. TNT ) ) {
// Player is allowed to place this block
}
3. Injecting Custom Dynamic Validators (RPG / Quests / Land Claims):
api. registerValidator ( (player, targetBlock, material, action ) -> {
// Example: Only players level 30 or higher can break Obsidian
if (action == BlockAction. BREAK && material == Material. OBSIDIAN ) {
if (player. getLevel ( ) < 30 ) {
return AccessDecision. DENY ;
}
}
return AccessDecision. PASSTHROUGH ;
} ) ;
4. Handling Custom Events:
@EventHandler
public void onBlockPrevented (PlayerBlockPreventedEvent event ) {
if (isInSpecialZone (event. getPlayer ( ) ) ) {
event. setCancelled ( true ) ; // Cancels the prevention, allowing the action
return ;
}
event. setCustomMessage ( Component. text ( "This block is protected!", NamedTextColor. RED ) ) ;
}
Code (Java):
import com.polarism.preventblock.api.PreventBlockAPI ;
PreventBlockAPI api = PreventBlockAPI. get ( ) ;
Code (Java):
Player player = ... ;
Block block = ... ;
if (api. canBreak (player, block ) ) {
// Player is allowed to break this block
}
if (api. canPlace (player, block, Material. TNT ) ) {
// Player is allowed to place this block
}
Code (Java):
api. registerValidator ( (player, targetBlock, material, action ) -> {
// Example: Only players level 30 or higher can break Obsidian
if (action == BlockAction. BREAK && material == Material. OBSIDIAN ) {
if (player. getLevel ( ) < 30 ) {
return AccessDecision. DENY ;
}
}
return AccessDecision. PASSTHROUGH ;
} ) ;
Code (Java):
@EventHandler
public void onBlockPrevented (PlayerBlockPreventedEvent event ) {
if (isInSpecialZone (event. getPlayer ( ) ) ) {
event. setCancelled ( true ) ; // Cancels the prevention, allowing the action
return ;
}
event. setCustomMessage ( Component. text ( "This block is protected!", NamedTextColor. RED ) ) ;
}
- Verify your server is running Paper 1.21.1 (or compatible forks) and Java 21.
- Place PreventBlock-1.0.0.jar into your server's plugins/ directory.
- Restart your server or load the plugin using a plugin manager.
- Customize plugins/PreventBlock/config.yml to fit your server needs.
- All rights reserved. Do not redistribute, modify, or resell this plugin without express authorization.
- If you encounter any issues or have feature requests, please contact the author directly via PM or the discussion tab.
- Please do not report bugs in the review section!
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.21, 26.1, 26.2
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Prevent Block is a free Minecraft Java mod. Compatible with Minecraft 1.21, 26.1, 26.2, 26.3. Downloaded 2 times (via Spigot). Download it and open it directly in the game.