ItzEmiliaTheFoxi

A Plugin where you can craft a custom "Debug Stick" which has all the normal Debug Stick functions but with restrictions so you can't cheat but only use on "Fence, Stairs, Iron Bars" it's craftable with one stick and one netherstar

Kodari AI
KodariApr 28 at 2:41 pm 7,879 (v2)

I’ll create a plugin that provides a craftable Debug Stick with restricted usage to prevent cheating.

RestrictedDebugStick
A survival-friendly plugin that allows players to craft a custom Debug Stick using a stick and nether star. This restricted version maintains all vanilla Debug Stick functionality for modifying block states, but only works on decorative blocks like fences, stairs, and iron bars. Perfect for builders who want block state control without the risk of cheating with gameplay-affecting blocks. Includes configurable block restrictions and permission controls.

Created RestrictedDebugStick plugin with crafting recipe (stick + nether star), block restriction system, and permission checks. The debug stick only works on configured blocks (fences, stairs, iron bars by default) and requires the restricteddebugstick.use permission.

ItzEmiliaTheFoxi

config reload command

Kodari AI
KodariApr 28 at 2:52 pm 10,184 (v2)

I’ll add a config reload command to the plugin.


Added /rdstick reload command with permission restricteddebugstick.reload (default: op). The command reloads the configuration and refreshes the allowed blocks list.

ItzEmiliaTheFoxi

stick has to work in survival too, not just in creative mode and has to work on a Hybrid Server, Mods and Plugins

Kodari AI
KodariApr 28 at 3:01 pm 7,470 (v2)

I’ll update the plugin to allow the debug stick to work in survival mode and ensure compatibility with hybrid servers.


Updated plugin for survival mode and hybrid server compatibility. The debug stick now:

  • Manually cycles block states (no creative mode required)

  • Left-click to select property (shift+left for previous)

  • Right-click to cycle property values

  • Works with all block data types (facing, axis, shape, waterlogged, etc.)

  • Uses pure Bukkit API for full hybrid server support (Mohist, Magma, Arclight)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
7 455
src/main/java/com/restricteddebugstick/RestrictedDebugStick.java
package com.restricteddebugstick;

import com.cryptomorin.xseries.XMaterial;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class RestrictedDebugStick extends JavaPlugin {
    private DebugStickManager debugStickManager;
    private NamespacedKey debugStickKey;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.debugStickKey = new NamespacedKey(this, "restricted_debug_stick");
        this.debugStickManager = new DebugStickManager(this);
        
        registerRecipe();
        getServer().getPluginManager().registerEvents(new DebugStickListener(this), this);
        getCommand("rdstick").setExecutor(new ReloadCommand(this));
        
        getLogger().info("RestrictedDebugStick has been enabled!");
    }

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

    private void registerRecipe() {
        XMaterial.matchXMaterial("DEBUG_STICK").ifPresent(debugStick -> {
            XMaterial.matchXMaterial("STICK").ifPresent(stick -> {
                XMaterial.matchXMaterial("NETHER_STAR").ifPresent(netherStar -> {
                    ShapedRecipe recipe = new ShapedRecipe(
                        new NamespacedKey(this, "restricted_debug_stick_recipe"),
                        debugStickManager.createDebugStick()
                    );
                    
                    recipe.shape(" N ", " S ", "   ");
                    recipe.setIngredient('N', netherStar.parseMaterial());
                    recipe.setIngredient('S', stick.parseMaterial());
                    
                    try {
                        Bukkit.addRecipe(recipe);
                        getLogger().info("Registered crafting recipe: Stick + Nether Star = Restricted Debug Stick");
                    } catch (Exception e) {
                        getLogger().warning("Failed to register recipe: " + e.getMessage());
                    }
                });
            });
        });
    }

    public String getMessage(String path) {
        String prefix = getConfig().getString("messages.prefix", "&6[DebugStick] &r");
        String message = getConfig().getString("messages." + path, path);
        return colorize(prefix + message);
    }

    public String colorize(String text) {
        return org.bukkit.ChatColor.translateAlternateColorCodes('&', text);
    }
}