Defining Extensions

A LimelightExtension is the basic building block of extending Limelight functionality. Limelight has several built-in extensions, but if you're adding Limelight compatibility or making a Limelight addon mod, you probably want to make your own extension.

Extensions can be individually disabled by the user, so if your addon is adding many unrelated sets of functionality, it is advised to make them separate extensions.

You can define and register an extension like so:

public class MyFunExtension implements LimelightExtension {
    public static final Identifier ID = Identifier.of("example-extension", "my_fun_extension");
    public static final MyFunExtension INSTANCE = new MyFunExtension();

    @Override
    public Identifier id() {
        return ID;
    }
}
public class ExampleLimelightCompat implements LimelightEntrypoint {
    @Override
    public void registerExtensions(Consumer<LimelightExtension> extensionRegistry) {
        extensionRegistry.accept(MyFunExtension.INSTANCE);
    }
}

You also need1 to provide a translatable title for the extension (and optionally a description):

en_us.json
{
    "limelightExtension.example-extension.my_fun_extension": "My Fun Extension",
    "limelightExtension.example-extension.my_fun_extension.desc": "Does very fun stuff!"
}

This results in this Limelight config screen entry: a config entry for My Fun Extension


  1. You can also override the LimelightExtension#name and LimelightExtension#description methods. 


Last update: 2024-08-30