HomeJavaModsBetterView
BetterView
ModsJava

BetterView

by booky10 · on Modrinth

A Paper plugin and Fabric mod to extend the normal server view distance without sacrificing server performance

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21.8–26.2 · Bukkit⬇ Download for 1.21.8–26.2 · Fabric⬇ Download for 1.21.8–26.2 · Folia⬇ Download for 1.21.8–26.2 · Paper⬇ Download for 1.21.8–26.2 · Purpur
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

BetterView

logo

GitHub tag (latest by date) GPLv3 License Discord

Description

BetterView is a high-performance Paper plugin and Fabric mod for Minecraft servers. It extends the normal view distance without sacrificing server performance using asynchronous player processing, direct chunk reading from disk, and caching of chunk data.

Features

Example: Loading speed for a view distance of 127 chunks

The screenshot below was taken at 0 2250 0 in the end dimension with a view distance of 127 chunks (with fog disabled). On an AMD Ryzen 7 5800X, all visible chunks were transmitted to the client in about 12 seconds after having joined the server with a cold cache and in about 9 seconds with a warm cache.

A top-down view of the main end island and parts of the outer end island

Supported Software

Minecraft Version Paper Fabric
26.2.x
26.1.x
1.21.11
1.21.10
1.21.9
1.21.8
1.21.7
1.21.6
1.21.5
1.21.4
1.21.3
1.21.1

On fabric, this mod depends on Moonrise and adventure-platform-mod to work.

Usage

On Paper servers, place the jar file in your plugins directory and restart your server. On Fabric servers/clients, place the jar file in your mods directory and restart your server or client. By default, BetterView will configure a view distance of 32 chunks for each dimension.

Configuration

On the first start, this plugin will automatically create a configuration file. If using Paper it will be created at plugins/BetterView/config.yml, if using Fabric it will be created as betterview.yml inside your world directory (e.g. world for dedicated servers). In there, you are able to configure the following options:

Feel free to play around with the chunk generations and chunk sending limits for an optimal experience on your server setup.

API Usage

Maven Repository: https://repo.minceraft.dev/releases/
Maven Artifact: dev.booky.betterview:betterview-api:2.2.0
Javadoc: https://repo.minceraft.dev/javadoc/releases/dev/booky/betterview/betterview-api/2.2.0

Example for Paper
// get the BetterView API instance using Bukkit's ServicesManager
// this is the only difference between using the API on paper and fabric
BvManager bvManager = Bukkit.getServicesManager().load(BvManager.class);
if (bvManager == null) {
    throw new IllegalStateException("Failed to load BetterView API");
}
// invalidate chunk cache at 0 0 in the overworld
BvLevel overworld = bvManager.getLevel(Key.key(Key.MINECRAFT_NAMESPACE, "overworld"));
overworld.invalidateChunkCache(0, 0);
// refresh the chunk for all players in the overworld
for (BvPlayer player : overworld.getPlayers()) {
    // (switch to proper thread for thread-safety)
    player.getExecutor().execute(() -> {
        if (!player.isActive() || player.getLevel() != overworld) {
            // player isn't active or isn't in overworld - maybe they have switched
            // dimensions in the short time it took for this code to run?
            return;
        }
        // ensure BetterView actually "owns" the chunk at 0 0
        if (player.getChunkLifecycle(0, 0).isOwned()) {
            // finally, queue the chunk to be refreshed!
            player.refreshChunk(0, 0);
        }
    });
}
Example for Fabric
// get the BetterView API instance using fabric's object share
// this is the only difference between using the API on paper and fabric
BvManager bvManager = (BvManager) FabricLoader.getInstance().getObjectShare().get("betterview:api");
if (bvManager == null) {
    throw new IllegalStateException("Failed to load BetterView API");
}
// invalidate chunk cache at 0 0 in the overworld
BvLevel overworld = bvManager.getLevel(Key.key(Key.MINECRAFT_NAMESPACE, "overworld"));
overworld.invalidateChunkCache(0, 0);
// refresh the chunk for all players in the overworld
for (BvPlayer player : overworld.getPlayers()) {
    // (switch to proper thread for thread-safety)
    player.getExecutor().execute(() -> {
        if (!player.isActive() || player.getLevel() != overworld) {
            // player isn't active or isn't in overworld - maybe they have switched
            // dimensions in the short time it took for this code to run?
            return;
        }
        // ensure BetterView actually "owns" the chunk at 0 0
        if (player.getChunkLifecycle(0, 0).isOwned()) {
            // finally, queue the chunk to be refreshed!
            player.refreshChunk(0, 0);
        }
    });
}

Please note that the API is still work in progress. Please be sure to post suggestions, enhancements or any other ideas on our Discord or in the issue tracker.

Building

  1. Clone the project (git clone https://github.com/MinceraftMC/BetterView.git)
  2. Go to the cloned directory (cd BetterView)
  3. Build the jar files (./gradlew build on Linux/MacOS, just gradlew build on Windows)

The jar files can be found in the buildlibs directory.

Contributing

If you want to contribute to BetterView, feel free to fork the repository and create a pull request. Please make sure to follow the code style and conventions used in the project. If you have any questions or need help, feel free to ask in our Discord.

You can test your changes by running ./gradlew :paper:runServer or ./gradlew :fabric:prodServer/./gradlew :fabric:prodClient respectively. This will start a local server with the compiled plugin or mod automatically installed, ready for debugging in your IDE.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more