Paper Plugin Guide
File mode0

Going further

Debugging like a pro

Find and fix bugs with logs, breakpoints and a calm process.

Beginner1 min read

This page is still being written.

What it will cover

  • The debugging mindset: reproduce, isolate, read the error, change one thing
  • Logging with getLogger().info/warning and a debug flag in config
  • IntelliJ debugger with the Run Paper Server debug button: breakpoints, stepping, watches, evaluate expression (x-mock references)
  • Reading stack traces from the server console (annotated example with Caused by and your plugin line)
  • Common runtime problems: listener not registered, event handler not public, wrong event import, command not registered, config not saved, plugin.yml main mismatch
  • Binary search debugging (comment out is not allowed in our code style: explain toggling code by early return instead)
  • Link to Error Doctor and FAQ
  • Example plugin with a deliberate bug to find (plugins/debugging-demo) and its fixed version described