Skip to content

Debug API #5045

@sylv256

Description

@sylv256

Summary

Debug API is a hypothetical toolkit for registering and using debug subscriptions and other debug tools Mojang have created.

Motivation

Presently, Mixin is required to add your own debug subscriptions to entities and other game objects. Mixin is great, really, but at a certain point it becomes annoying, especially when you want to make a quick and dirty debug renderer and subscription, and at that point, you might as well use print debugging.

Explanation

A Debug API would implement methods to register debug subscriptions on the client and server, potentially on existing game objects as well. This would make implementing debug renderers easier as modders could properly use DebugValueAccess on which we could also add an injected interface for more customization. This API would also have its own module for ease of maintainability.

Drawbacks

This would add a new module (oh no!), further reducing performance in Fabric API development, and annoying the tater out of maintainers.

Rationale and Alternatives

  • You could theoretically shove some of the described features into unrelated modules, but that would be more annoying to maintain.
  • This makes it easier for modders to create debug features with no hassle.

Prior Art

See #5035 testmod.

Unresolved Questions

  • Should we keep DebugRendererRegistry in fabric-rendering-v1? It's probably fine to stay there, but moving it here could also have benefits.
  • Should adding debug subscriptions on existing game objects be event-based or registry-based?
  • Is this even in scope for Fabric API?

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnew modulePull requests that introduce new modules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions