Most Minecraft plugin "testing" is: install the jar, join with your client, punch things, eyeball it. That doesn't scale when your plugin's whole job is managing death states β you need two clients, deterministic damage, and assertions on things that happen in the world after a player dies.
Here's the setup I use to e2e-test Paper plugins on a headless VM: mineflayer bots + RCON .
The pieces
# Paper server (test instance, separate dir) java -jar paper-1.21.4.jar --nogui
Enter fullscreen mode
Exit fullscreen mode
mineflayer (Node.js) β headless Minecraft clients. Two bots: victim and helper .
RCON β server console over TCP. The only reliable way to apply real damage ( /damage ), teleport, and set gamemode.
Assertions: check player state via mineflayer ( entity.health , bot.game.gameMode ), and world state via RCON ( /execute if block , /data get ).
Gotchas that will waste your day
/kill reports damage source KILL , not GENERIC_KILL .β¦