📄
pasted-code-1790334345770.txt
txt
17 lines
▶
Act as an expert Minecraft Spigot/Paper plugin developer.
Write a complete, optimized Java plugin for a Paper 1.26.2 server that re-enables traditional "Carpet Duping" machines. Because Paper patches vanilla redstone duping exploits by default, this plugin needs to manually detect the specific redstone duper mechanic and drop a carpet item when it triggers.
Requirements for the plugin:
1. Target Version: Paper / Spigot 1.26.2 (Java 21).
2. Detection Logic:
Listen for piston extension/retraction events (BlockPistonExtendEvent / BlockPistonRetractEvent).
Check if the moving blocks involve Slime Blocks moving adjacent to a Coral Fan (specifically Dead Tube Coral Fan, Dead Brain Coral Fan, etc.) and Carpets.
3. Behavior:
When a Sticky Piston pushes/pulls a Slime Block structure containing a carpet and a dead coral fan, spawn a duplicate Carpet item drop in the world at the machine's front location, exactly mimicking the vanilla exploit shown in traditional YouTube carpet dupers (Observer -> Sticky Piston -> 4 Slime Blocks -> Dead Coral Fan -> Carpets).
4. Performance:
Ensure the code is performant and doesn't lag the server during heavy redstone loops. Use block checks efficiently.
Provide the main plugin class, the event listener class, and the plugin.yml file structure.
Add a Java 21 Gradle build targeting Paper 1.26.2.
Implement piston-event detection for sticky pistons, moved slime blocks, adjacent carpets, and dead coral fans.
Register the listener and add
plugin.ymlmetadata.
Created the Java 21 Paper plugin with piston extend/retract detection, sticky-piston and slime checks, and carpet duplication when an adjacent dead coral fan/carpet pattern is found. Added the Gradle build and plugin.yml; each matching piston event drops one carpet at the piston’s front.
its not working it wont duplicate
The listener referenced XSeries, but XSeries wasn’t included in the project dependencies, so the plugin couldn’t compile correctly. I removed that dependency from the listener and now read block names directly.
Rebuild the plugin and replace the old JAR on your server. The dupe detection still requires the moved slime block, dead coral fan, and carpet to be adjacent in the machine.
package com.kodari.carpetduper;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class CarpetDuperPlugin extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(new CarpetDuperListener(), this);
}
}