Test Runner API
test(name, options?, fn)
Defines an individual test case.
Runs N independent instances of the test simultaneously with distinct leased accounts to detect race conditions.
describe.serial(name, options?, fn)
Groups tests that execute sequentially while retaining the same player/bot session and leased account across all tests in the block.
afterAll(fn)
Registers a hook that runs once per instance of the enclosing describe.serial block, after its last executed test — whether the block finished all its tests, stopped early on a failure, or a test in it was skipped. Only valid inside describe.serial. Not called if the block never got its player (the initial connect failed). A throwing hook is logged, not fatal.
player / bot Object
The player or bot object represents a real Minecraft client connected to the test server.
Methods
player.chat(message)
Sends a chat message or command.
player.gui(options)
Waits for a GUI to open matching the title and returns a live handle.
player.makeOp()
Grants operator status to the player.
player.deOp()
Removes operator status from the player.
player.setGameMode(mode)
Changes the player’s game mode.
player.teleport(x, y, z)
Teleports the player to coordinates.
player.giveItem(item, count?)
Gives items to the player.
player.clearInventory(item?, options?)
Clears the player’s inventory and waits until the client-side inventory state reflects it. If an item name is specified, only that item is cleared.
Properties
server Object
The server object gives you control over the backend Minecraft server.
Methods
server.execute(command)
Executes a command from the server console.
Exported Utilities
The Plugwright framework exports several utility functions to help you write robust tests.createPlayer()
Creates a new, independent player bot that joins the server. Useful for multi-user tests.
Connect as this exact name instead of taking whatever the environment’s account pool has free.
Names the bot inside a
describe.serial block, so a later test in that block gets the same bot
back instead of connecting another one.The password an authentication plugin logs
username in with. Only for a named bot: a pool
account already carries its own, and passing both is an error.sleep(ms)
Pauses execution for a specified number of milliseconds.
poll(fn, options?)
Repeatedly executes a function until it returns a value that is not undefined, and returns that value. Useful when you are waiting for an object or value to exist and need to extract it.
waitForAssertion(fn, options?)
Executes an assertion function repeatedly until it passes or times out. Ideal for expect statements.
waitUntil(predicate, options?)
Repeatedly executes a boolean function until it returns true. Useful when you simply want to pause execution until a condition is met, without extracting any data.