Skip to content

feat: bind the debug-utilities script module - #216

Merged
NaySurGithub merged 1 commit into
devfrom
feat/script-debug-gametest
Nov 12, 2026
Merged

NaySurGithub merged 1 commit into
devfrom
feat/script-debug-gametest

Conversation

@NaySurGithub

Copy link
Copy Markdown
Contributor

What this does

Binds @minecraft/debug-utilities (beta) for behavior packs.

  • Debug drawer: DebugShape and its ten shapes (DebugLine, DebugArrow, DebugBox, DebugSphere, DebugCircle, DebugText, DebugCylinder, DebugCone, DebugEllipsoid, DebugPyramid) and debugDrawer. Added shapes stream to players through PrimitiveShapesPacket once per tick: a snapshot when a player starts seeing a shape or the shape changes, the id alone when it goes away. visibleTo, hiddenFrom and defaultVisibleToAll pick the recipients; timeLeft counts down in seconds and removes the shape at zero.
  • Shape defaults come from the 26.60 constructors (sub_14B8D88B0 and the per-type ones): scale 1, white, arrow head length 1, radius 0.5 and 4 segments, box bound 1, sphere and circle 20 segments, cylinder, cone and ellipsoid radii 1, height 1 and 20 segments, pyramid width and height 1. Segment counts are bounded to [3, 128] and maximumRenderDistance to 0 and up, with ArgumentOutOfBoundsError. A RawMessage text goes out as its JSON, like sub_14B8E1D00.
  • Diagnostics manager: tabs and views with the game's DiagnosticsError messages and reasons (tabName must be non-empty, Tab with the name '...' already exists!, statName must be non-empty, Stats have already been pushed this frame!). Falcon has no script debugger, so pushed stats are kept but nothing displays them.
  • Stats: collectRuntimeStats reads QuickJS's memory usage, field for field. collectPluginStats lists every scripted pack with its uuid, module uuid and live handles by class, counted when native objects are made and finalized.
  • disableWatchdogTimingWarnings stores the flag per pack. Falcon's watchdog only stops runaway scripts and emits no slow or spike warnings, so there is nothing else to turn off yet.
  • Every member refuses early execution like the native bindings.
  • Infrastructure: the generator and the surface table learn the debug: module; ScriptEngine::getApis; ScriptApi keeps its pack uuid.

Depends on Falcon-MC/Protocol#9 (cylinders carry one radii pair in 26.60), already merged.

How it is verified

New script-api-debug test: shapes reach the player in one packet with the expected fields, unchanged shapes are not resent, an expired box, a removed arrow and a recolored text go out on the right tick; diagnostics errors, bounds errors, constructor errors and early execution; runtime and plugin stats. Full ctest passes.

AI disclosure

Written by Claude Opus 5.5 (claude-opus-5-5); game values were read from the 26.60 client in IDA.

@NaySurGithub
NaySurGithub merged commit d6ba43c into dev Nov 12, 2026
6 of 8 checks passed
@NaySurGithub
NaySurGithub deleted the feat/script-debug-gametest branch November 12, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant