Wemmbu Wemmbu

Make me a plugin where if u type /nobreakwand it gives u a wand where if u clik to corners and type /confirm it makes it so those blokck cant be broken by anyone and if i type/unbreakundo it undose it

Kodari AI
KodariSep 6 at 12:14 am 1
NoBreakWand
A Minecraft plugin that provides a special wand item via the /nobreakwand command. Players use the wand to left-click and right-click two corner blocks to define a cuboid region. Typing /confirm locks the region, making all blocks within it unbreakable by any player. The /unbreakundo command removes the protection from the most recently locked region, restoring breakability. The plugin tracks regions per player, validates wand usage, and prevents griefing by enforcing block protection on all interaction events.

I’ll create the complete NoBreakWand plugin with corner selection, confirmation, persistent protections, undo support, and explosion protection.

Created the complete NoBreakWand plugin.

Features:

  • /nobreakwand gives a custom selection wand.

  • Right-click sets the first corner.

  • Left-click sets the second corner.

  • /confirm permanently protects the selected cuboid.

  • /unbreakundo removes your most recently created protected region.

  • Protected blocks cannot be broken by anyone.

  • Explosions cannot destroy protected blocks.

  • Regions persist in plugins/NoBreakWand/regions.yml.

  • Includes permissions and plugin configuration.

Wemmbu Wemmbu

Only if you are op

Kodari AI
KodariSep 6 at 12:14 am 1
  • Restrict /nobreakwand, /confirm, and /unbreakundo to operators.

  • Restrict wand corner selection to operators, including wands obtained from another player.

  • Set the Bukkit permission’s default to operator-only.

Updated so only server operators can:

  • Use /nobreakwand

  • Set wand corners

  • Use /confirm

  • Use /unbreakundo

The permission nobreakwand.use is also now operator-only by default.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
11 476
src/main/java/com/kodari/nobreakwand/NoBreakWandPlugin.java
package com.kodari.nobreakwand;

import java.util.Objects;
import org.bukkit.plugin.java.JavaPlugin;

public final class NoBreakWandPlugin extends JavaPlugin {

    private SelectionManager selectionManager;
    private ProtectionManager protectionManager;

    @Override
    public void onEnable() {
        this.selectionManager = new SelectionManager();
        this.protectionManager = new ProtectionManager(this);
        this.protectionManager.load();

        WandUtil wandUtil = new WandUtil(this);
        getServer().getPluginManager().registerEvents(
                new ProtectionListener(selectionManager, protectionManager, wandUtil), this);

        NoBreakCommand command = new NoBreakCommand(selectionManager, protectionManager, wandUtil);
        Objects.requireNonNull(getCommand("nobreakwand")).setExecutor(command);
        Objects.requireNonNull(getCommand("confirm")).setExecutor(command);
        Objects.requireNonNull(getCommand("unbreakundo")).setExecutor(command);
    }

    @Override
    public void onDisable() {
        if (protectionManager != null) {
            protectionManager.save();
        }
    }
}