📄
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.
Create a Java 21 Gradle project targeting Paper 1.21.11.
Add a shears-only interaction listener that waits for the real disarmed state transition.
Validate a genuine two-hook tripwire line before dropping exactly one extra vanilla string.
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:
gradle build
The compiled plugin will be located at:
build/libs/string-tripwire-duper-1.0.0.jar
Install
Stop the Paper 1.21.11 server.
Copy the JAR into the server’s
pluginsfolder.Start the server.
The plugin creates its configuration at:
plugins/StringTripwireDuper/config.yml
Set enabled: false there to disable the mechanic.
Test
Enter survival mode.
Build two tripwire hooks facing each other.
Connect them with an uninterrupted tripwire line.
Right-click a tripwire segment with shears.
The segment remains in place and becomes disarmed.
One additional string item should drop.
Breaking the tripwire with a hand, sword, or any non-shears tool will not produce the duplicated string.
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);
}
}