Menu

How to e2e-test Minecraft Paper plugins with headless bots (mineflayer + RCON)
πŸ“°

How to e2e-test Minecraft Paper plugins with headless bots (mineflayer + RCON)

DEV Community: javaΒ·SecondWindMCΒ·11 days ago
#BO5MTNoM
#devtojava#devto#dev#death#rcon
Long article (451 words) β€” no AI summary yet.
Reading 0:00
15s threshold

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 .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.