Wiki 9Minecraft Wiki 9Minecraft
Distant Horizons Api Wiki › Guides › How to Use the Distant Horizons API to Add Custom Distant Terrain to Your Mod

How to Use the Distant Horizons API to Add Custom Distant Terrain to Your Mod

Understanding the API Entry Point

The Distant Horizons API Mod exposes a loader-independent interface that your mod can call to interact with Distant Horizons' terrain generation and rendering systems. Before writing any code, confirm that your mod declares a dependency on the API mod in its metadata so the classes are available at runtime on every supported loader.

Hooking Into Terrain Generation

1. Locate the API's main access class (the one the mod exposes for external calls). This is the single entry point you should use rather than reaching into Distant Horizons internals directly.

2. Register your custom terrain provider or override callback during your mod's initialization phase, before world load.

3. Inside your callback, return the terrain data Distant Horizons should display for the requested chunk region. Keep the data format consistent with what the API expects — mismatched structures will simply be ignored or cause the distant terrain to fail to render.

4. Test in a fresh world with Distant Horizons enabled and your render distance pushed out far enough that distant chunks are actually visible.

Verifying Your Integration

If distant terrain does not appear, first check that Distant Horizons itself is installed and working without your mod. Then confirm your dependency declaration and that your registration runs before the world loads. Because the API is loader-independent, the same code path should behave identically across loaders — if it works on one, it should work on the others.