Direct answer

When a command causes a freeze, run spark during repeated executions and inspect the command handler path. A command can be slow because of permission hooks, entity scans, database queries or world generation.

How to check it

  1. Identify the exact command, who runs it, argument size, affected world and whether it is a vanilla or plugin command. Do not test potentially destructive commands on production.
  2. Use a staging server or safe test user. Start /spark profiler start --timeout 180, then run the problematic command several times with consistent arguments.
  3. Open the viewer on the affected tick thread and locate command parsing/dispatch plus plugin package methods under that branch.
  4. Check nearby log errors and external dependencies such as SQL or web requests. A CPU sample profiler may not directly reveal every blocked I/O wait.
  5. Compare command time and tick spikes to a control run with the plugin or feature disabled safely.

What to change

  • Use a more specific selector or smaller batch size when the command scans many chunks/entities.
  • Update or report slow plugin handlers to the developer with the exact command and spark evidence.
  • Avoid asynchronous execution of world API calls unless the platform and API explicitly permit it.

Software and version notes

Plugin command behavior and permissions differ by software and plugin version. Console invocation can differ from an in-game player due to permissions or target world.

Verify the result

  • Re-run the same command with matching data size and check tick spikes.
  • Verify permissions, returned results and any persistent world changes remain correct.
  • Keep the baseline profile to identify regressions after future updates.

References