You have three options, ranging from quick fixes to permanent architecture changes.
The trap operates on a three-phase cycle:
Use a small plugin (Sponge/Bukkit/Paper) or a server-side script that listens for trap triggers (via redstone or via player movement events) and writes to a log file. This gives a real persistent audit file.
Plugin approach (Paper/Spigot plugin—Java; outline): lovely craft piston trap save data full
Minimal Java snippet (conceptual):
String entry = String.format("%s,%s,%s,%d,%.2f,%.2f,%.2f%n",
Instant.now().toString(),
player.getName(),
world.getName(),
player.getEntityId(),
loc.getX(), loc.getY(), loc.getZ());
Files.write(logPath, entry.getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE, StandardOpenOption.APPEND);
Datapack approach (no plugin, uses server functions):
Example: Use /data modify storage lovely:trap log append value time:"2026-04-08T...",player:"Steve",pos:[x,y,z] You have three options, ranging from quick fixes
Then extract world/data/.dat with NBT tools to export logs.
This trap is "lovely" because it’s concealed with matching blocks, silent (using observers instead of clicking repeaters), and doesn’t kill — perfect for server pranks or adventure maps.
(On screen: Player places pistons)
Narrator: "Today, we’re building a hidden piston trap in Lovely Craft. But first — check your save data. A full save can corrupt your trap when reloading." Append a line to a UTF-8 log file (e
(Show save data menu, clear space)
Narrator: "Clear at least 50MB to avoid errors. Now, let’s wire these pistons..."
(Trap triggers — victim falls)
Narrator: "And that’s how you save your trap — both in-game and in your data storage!"