Griffindor512

A java 1.21.x plugin that reintroduces the patched minecraft bug that allows players to place redstone dust on trapdoors

Kodari AI
KodariMay 8 at 10:26 am 4,684 (v2)

I’ll create a plugin that reintroduces the classic Minecraft bug allowing redstone dust placement on trapdoors.

TrapdoorRedstone
Reintroduces the patched Minecraft bug that allows players to place redstone dust on trapdoors. This restoration enables classic redstone builds and contraptions that relied on this mechanic. Features configurable enable/disable toggle, permission-based access control, and full cross-version compatibility from 1.8 to 1.21+. Listens for redstone placement attempts on all trapdoor variants and bypasses vanilla restrictions.

Now I’ll create the plugin structure:


TrapdoorRedstone plugin created! Reintroduces the classic Minecraft bug allowing redstone dust placement on all trapdoor types (wooden, iron, and copper variants). Features include configurable enable/disable toggle, optional permission requirement, per-world control, and debug logging. Uses XSeries for full 1.8-1.21+ compatibility.

Griffindor512

tell me about the plugin functions and permissions

Kodari AI
KodariMay 8 at 10:27 am 4,345 (v2)

TrapdoorRedstone Plugin - Functions & Permissions

Core Function

The plugin reintroduces the classic Minecraft bug that allowed players to place redstone dust directly on trapdoors. This was a mechanic that existed in older Minecraft versions and was later patched by Mojang.

How It Works

  • Listens for redstone placement attempts using the BlockPlaceEvent

  • Detects if redstone is being placed on a trapdoor (checks the block below)

  • Uncancels the event if it was blocked by vanilla mechanics, allowing the placement

  • Supports all trapdoor types: All wood variants (oak, spruce, birch, jungle, acacia, dark oak, crimson, warped, mangrove, cherry, bamboo), iron trapdoors, and all copper trapdoor variants (including oxidized and waxed)

Configuration Options

Option
Default
Description
enabled
true
Master toggle for the entire feature
require-permission
false
If
true
, players need
trapdoorredstone.use
permission to place redstone on trapdoors
enabled-worlds
[]
List of world names where this works. Empty list = all worlds
debug
false
Logs each successful redstone placement to console

Permissions

Permission
Default
Description
trapdoorredstone.use
true
(everyone)
Allows placing redstone on trapdoors (only checked if
require-permission: true
in config)
trapdoorredstone.reload
op
only
Allows using
/trapdoorredstone reload
command

Commands

Command
Aliases
Permission
Description
/trapdoorredstone [reload]
/tpr
,
/tdredstone
trapdoorredstone.reload
Reloads the configuration file and displays current status

Example Use Cases

Scenario 1: Open to everyone (default)

  • Config: require-permission: false

  • Result: All players can place redstone on trapdoors

Scenario 2: VIP/Donor only

  • Config: require-permission: true

  • Grant trapdoorredstone.use to specific groups via LuckPerms/other permission plugin

  • Result: Only players with permission can use this feature

Scenario 3: Creative world only

  • Config: enabled-worlds: [creative, plots]

  • Result: Feature only works in those specific worlds

Scenario 4: Temporarily disable

  • Config: enabled: false

  • Result: Reverts to vanilla Minecraft behavior (redstone can’t be placed on trapdoors)

Griffindor512

add message prefix with support with multi colours

Kodari AI
KodariMay 8 at 10:29 am 7,482 (v2)

I’ll add MiniMessage support with a configurable multi-color prefix to the plugin.

Perfect! I’ve added multi-color message prefix support to the plugin:

What Changed

1. Created ColorUtil class (util/ColorUtil.java)

  • Handles MiniMessage formatting for colors and gradients

  • Supports all MiniMessage features (gradients, hex colors, rainbow, etc.)

2. Updated config.yml with:

  • prefix: Customizable prefix with multi-color support (default: red-to-orange gradient)

  • messages section: All command messages are now configurable

3. Updated ReloadCommand to use:

  • ColorUtil for message formatting

  • Configurable prefix from config

  • Configurable messages

Prefix Examples

You can customize the prefix in config.yml with any MiniMessage format:

YAML
# Gradient (default)
prefix: "<gradient:#FF5555:#FFAA00>[TrapdoorRedstone]</gradient> "

# Rainbow
prefix: "<rainbow>[TrapdoorRedstone]</rainbow> "

# Hex colors
prefix: "<#FF5555>[<#FFAA00>TDR</#FFAA00>]</#FF5555> "

# Standard colors + formatting
prefix: "<red><bold>[TrapdoorRedstone]</bold></red> "

# Multi-gradient
prefix: "<gradient:red:gold:yellow>TrapdoorRedstone</gradient> <dark_gray>» "

# No prefix
prefix: ""

All messages now support full MiniMessage formatting including gradients, rainbow text, hex colors, and all standard formatting options!

Griffindor512

when i try to put redstone dust on trapdoors, it just drops into an item

Kodari AI
KodariMay 8 at 2:43 pm 7,217 (v2)

I see the issue! The BlockPlaceEvent only fires if Minecraft allows the placement. Since vanilla Minecraft prevents redstone from being placed on trapdoors at a lower level, the event never fires. We need to use PlayerInteractEvent to intercept the action earlier and manually place the redstone.


Fixed! The issue was that BlockPlaceEvent only fires when Minecraft allows placement. Since vanilla Minecraft blocks redstone on trapdoors at a lower level, the event never triggered.

New approach:

  • Uses PlayerInteractEvent to detect right-clicks with redstone dust on trapdoors

  • Manually places the redstone wire block above the trapdoor

  • Reduces item count in survival/adventure mode

  • Completely bypasses vanilla placement restrictions

Now you should be able to place redstone dust directly on trapdoors! The plugin intercepts the interaction before Minecraft’s validation kicks in.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 293
src/main/java/com/trapdoorredstone/TrapdoorRedstone.java
package com.trapdoorredstone;

import com.trapdoorredstone.listeners.RedstoneListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

public class TrapdoorRedstone extends JavaPlugin {

    @Getter
    private static TrapdoorRedstone instance;

    @Override
    public void onEnable() {
        instance = this;

        saveDefaultConfig();

        getServer().getPluginManager().registerEvents(new RedstoneListener(this), this);

        if (getCommand("trapdoorredstone") != null) {
            getCommand("trapdoorredstone").setExecutor(new ReloadCommand(this));
        }

        getLogger().info("TrapdoorRedstone has been enabled!");
        if (getConfig().getBoolean("enabled", true)) {
            getLogger().info("Redstone placement on trapdoors is ENABLED");
        } else {
            getLogger().info("Redstone placement on trapdoors is DISABLED");
        }
    }

    @Override
    public void onDisable() {
        getLogger().info("TrapdoorRedstone has been disabled!");
    }

    public void reload() {
        reloadConfig();
    }
}