dripng

make a plugin where no one can place string not even operators

Kodari AI
KodariMay 16 at 6:45 am 2,768 (v2)

I’ll create a simple plugin that prevents anyone from placing string blocks, including operators.

StringBlocker
A lightweight plugin that prevents all players, including server operators, from placing string blocks in the world. Features a configurable denial message and the ability to toggle the restriction on or off. Supports all Minecraft versions through XSeries compatibility layer.

Created! This plugin prevents all players—including operators—from placing string blocks.

Features:

  • Cancels block placement for STRING material

  • Works for everyone (no permission checks)

  • Configurable enable/disable toggle

  • Customizable denial message with color code support

  • Cross-version compatible using XMaterial

The listener uses EventPriority.HIGHEST to ensure it runs late in the event chain, and checks the placed block type using XSeries for compatibility across all Minecraft versions.

dripng

i can still place it

Kodari AI
KodariMay 16 at 6:55 am 4,116 (v2)

Let me read the files to see what might

I found the issue! When you place string as an item, the block that gets placed is TRIPWIRE, not STRING. Let me fix this:

Fixed! The issue was that when you place string (the item), it becomes a TRIPWIRE block. The plugin now correctly checks for XMaterial.TRIPWIRE instead of XMaterial.STRING. Try placing string now—it should be blocked for everyone including operators.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
5 100
src/main/java/com/stringblocker/StringBlocker.java
package com.stringblocker;

import com.stringblocker.listener.BlockPlaceListener;
import org.bukkit.plugin.java.JavaPlugin;

public class StringBlocker extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        getServer().getPluginManager().registerEvents(new BlockPlaceListener(this), this);
        
        getLogger().info("StringBlocker has been enabled!");
    }

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