Home›Java›Mods›Prevent Block
Prevent Block
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 Spigot

PREVENTBLOCK
Advanced Block Break & Place Protection with Developer API
Native Version: Paper 1.21.1 (Java 21)
[​IMG] [​IMG] [​IMG]
​
✦ OVERVIEW ✦
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 ✦
✦ COMMANDS & PERMISSIONS ✦
Main Command: /preventblock (Alias: /pb)
Admin Permission: preventblock.admin
Permission Nodes:
✦ CONFIGURATION ✦
Spoiler: Click to view config.yml
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"
 
✦ DEVELOPER API ✦
Spoiler: Click to view Developer API Examples
1. Obtaining the API Instance:
Code (Java):

import com.polarism.preventblock.api.PreventBlockAPI ;
PreventBlockAPI api = PreventBlockAPI. get ( ) ;
 
2. Checking Block Access:
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
}
 
3. Injecting Custom Dynamic Validators (RPG / Quests / Land Claims):
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 ;
} ) ;
 
4. Handling Custom Events:
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 ) ) ;
}
 
✦ INSTALLATION ✦
  1. Verify your server is running Paper 1.21.1 (or compatible forks) and Java 21.
  2. Place PreventBlock-1.0.0.jar into your server's plugins/ directory.
  3. Restart your server or load the plugin using a plugin manager.
  4. Customize plugins/PreventBlock/config.yml to fit your server needs.
✦ TERMS & SUPPORT ✦

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

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.

Explore more