Skip to content

API and Addon Integration

Rifa edited this page Aug 9, 2026 · 1 revision

API & Addon Integration

This document outlines how developers can interface with Speedometer or inspect its registration patterns for custom F3 debug entries.


📊 API Summary Infobox

Property Specification
Public Constants Class net.vanillaoutsider.speedometer.SpeedometerMod
Speedometer Identifier Identifier.withDefaultNamespace("speedometer")
Vanilla Player Speed Identifier Identifier.withDefaultNamespace("player_speed")
Custom Entry Interface net.minecraft.client.gui.components.debug.DebugScreenEntry

💡 Spy-Wrapper Pattern Reference

Developers seeking to extend or wrap vanilla debug entries can reference Speedometer's DebugEntryPlayerSpeedWrapper spy-wrapper pattern:

public class DebugEntryPlayerSpeedWrapper implements DebugScreenEntry {
    private final DebugScreenEntry parent;

    public DebugEntryPlayerSpeedWrapper(DebugScreenEntry parent) {
        this.parent = parent;
    }

    @Override
    public void display(DebugScreenDisplayer displayer, Level level, LevelChunk clientChunk, LevelChunk serverChunk) {
        DebugScreenDisplayer spyDisplayer = new DebugScreenDisplayer() {
            @Override
            public void addLine(String line) {
                displayer.addLine(modifyLine(line));
            }
            
            private String modifyLine(String original) {
                if (original != null && original.startsWith("Speed: ")) {
                    // Append custom data
                    return original + ", custom suffix";
                }
                return original;
            }
        };
        parent.display(spyDisplayer, level, clientChunk, serverChunk);
    }
}

This pattern delegates rendering to the underlying vanilla entry while allowing dynamic string modification without breaking compatibility with other mods.


🔗 Related Pages

📖 Speedometer Wiki

🌐 Languages


🇺🇸 English
🇨🇳 简体中文 (Simplified Chinese)
🇭🇰 繁體中文 (Traditional Chinese)
🇷🇺 Русский (Russian)
🇪🇸 Español (Spanish)
🇩🇪 Deutsch (German)
🇫🇷 Français (French)
🇧🇷 Português (Portuguese)
🇯🇵 日本語 (Japanese)
🇮🇩 Bahasa Indonesia (Indonesian)
🇰🇷 한국어 (Korean)

🔗 External Links

Clone this wiki locally