Buster Alt
📎 1 file 1,309 chars
📄
pasted-code-1787986200834.txt
txt 18 lines
▶
Create a Paper plugin for Minecraft 1.21.11 that recreates the old Minecraft 1.21.1 string/tripwire duper behavior.

Requirements:

* The plugin must work on Paper 1.21.11.
* Recreate the old string duper mechanic as closely as possible.
* The duper should only activate when the tripwire is **disarmed using shears**.
* Simply breaking the tripwire by hand, with a sword, or with another tool must NOT activate the duper.
* When the player uses shears to disarm the tripwire in the correct duper setup, the plugin should detect it and produce the duplicated string exactly as the old mechanic did.
* It must work with normal survival gameplay and should not require commands.
* Do not use a custom GUI or custom items.
* Do not give string just because a player breaks tripwire; detect the actual shears-based disarming action.
* Make sure the detection works with Paper 1.21.11's current event/API system.
* Prevent accidental duplication outside the intended tripwire setup.
* Include a complete, ready-to-compile plugin with `plugin.yml`, Java source code, and all required configuration.
* Explain exactly how to build, install, and test the plugin.
* Prioritize making the mechanic actually work on Paper 1.21.11 rather than simply simulating it with a command or manual string reward.
Kodari AI
KodariAug 29 at 6:54 am 1
TripwireDuper
A Paper 1.21.11 plugin that recreates the classic string/tripwire duplication mechanic. Detects when a player uses shears to disarm a tripwire in a valid duper setup and spawns the duplicated string item at the tripwire location. Only activates on shears-based disarming, not on breaking with other tools. Uses PlayerInteractEvent to detect shear usage on tripwire blocks, validates the tripwire is part of a proper duper configuration (tripwire above a block with string attached), and spawns one string item per successful disarm. Works naturally in survival gameplay with no commands or GUI required. Includes complete plugin.yml, Java source, and build instructions for Paper 1.21.11.
  1. Create a Java 21 Gradle project targeting Paper 1.21.11.

  2. Add a shears-only interaction listener that waits for the real disarmed state transition.

  3. Validate a genuine two-hook tripwire line before dropping exactly one extra vanilla string.

  4. Add plugin metadata and minimal configuration.

Implemented a complete Paper 1.21.11 plugin.

Behavior

  • Activates only when a player right-clicks tripwire with shears.

  • Waits for Paper to mark the tripwire as disarmed.

  • Requires:

    • Two opposing tripwire hooks.

    • A continuous tripwire line between them.

    • Hooks within the vanilla 42-block connection limit.

    • Survival mode.

  • Drops exactly one additional vanilla string item.

  • Hand, sword, or other tools do not activate it.

  • No commands, GUI, or custom items are used.

Build

From the project root:

Shell
gradle build

The compiled plugin will be located at:

Plain Text
build/libs/string-tripwire-duper-1.0.0.jar

Install

  1. Stop the Paper 1.21.11 server.

  2. Copy the JAR into the server’s plugins folder.

  3. Start the server.

  4. The plugin creates its configuration at:

Plain Text
plugins/StringTripwireDuper/config.yml

Set enabled: false there to disable the mechanic.

Test

  1. Enter survival mode.

  2. Build two tripwire hooks facing each other.

  3. Connect them with an uninterrupted tripwire line.

  4. Right-click a tripwire segment with shears.

  5. The segment remains in place and becomes disarmed.

  6. One additional string item should drop.

Breaking the tripwire with a hand, sword, or any non-shears tool will not produce the duplicated string.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 196
src/main/java/com/kodari/stringduper/StringTripwireDuperPlugin.java
package com.kodari.stringduper;

import com.kodari.stringduper.listener.TripwireDisarmListener;
import org.bukkit.plugin.java.JavaPlugin;

public final class StringTripwireDuperPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new TripwireDisarmListener(this), this);
    }
}