Skip to main content
The Players surface lets you create mock player entities for testing without a real client connection. PlayerTestAdapter provides mock player creation and property access, while PlayerAssert verifies game mode, name, world assignment, and alive state. Testing player logic without real clients is essential for CI/CD pipelines and automated regression testing. Mock players let you verify game mode switches, world assignments, and player-specific permissions entirely on the server side.

Complete Example Suite

Adapter Methods

Assertion Methods

When to Test Players

Player tests are valuable when your mod:
  • Implements game mode switches (survival to creative, custom modes)
  • Assigns players to specific worlds (lobbies, dungeons, arenas)
  • Has player-specific logic that needs verification without real clients
  • Combines with permission checks (see Permissions)

Next Steps