Mineuniverse
Mods
Remnant: OPC

Remnant: OPC

MOD
A Minecraft library for Fabric and NeoForge that keeps registered player data accessible while players are offline.
by bibireden
Download Claim this project
1,364 downloads
0 likes
0 followers
Updated Oct 14, 2026
0 hypes
Follow0
API and Library Server Utility Utility & QoL
Advertisement Remove ads with Premium →
Offline Player Cache Banner fabric quilt forge java gradle

Preamble 📝

Offline Player Cache: Directors Cut has been completely redone from the ground up, and its framework predates 1.* and below. This was developed in mind to have persistent leaderboards for servers for their offline players.

Content 📦

Modders may register Record's linked with an id and a Codec to serialize/deserialize it. Upon a player's disconnection from the server, their cached data is stored into the servers level data, which then can be accessed through code or through the commands the mod provides. Upon a player's reconnection to the server, their cached data is deleted.

Commands

/opc get <uuid>|<name> <key>

Provides details about the current player value. If they are online, it will provide their current value, but if they are offline, it will provide their cached value.

/opc remove <uuid>|<name> <key>

If the player with the associated username or UUID is offline, it will remove that players cached value based on the selected key. If the player is online, nothing will occur with this command.

/opc list <uuid>|<name>

Lists all the keys and values this player has stored if they are offline, or if they are online, their current ones.

Developers Guide

Setup

Offline Player Cache has a Modrinth and Curseforge page. In order to develop with the API, please add the following: gradle.properties
opc_version=...
build.gradle
repositories {
    maven {
        name = "Modrinth"
        url = "" rel="noopener nofollow" target="_blank">https://api.modrinth.com/maven&quot;
        content {
            includeGroup "maven.modrinth"
        }
    }
}
dependencies {
modImplementation "maven.modrinth:opc-directors-cut:$"
// include this if you do not want to force your users to install the mod.
include "maven.modrinth:opc-directors-cut:$"
}
<details><summary>Alternatively, if you are using Kotlin DSL:</summary> build.gradle.kts
repositories {
    maven {
        name = "Modrinth"
        url = uri("" rel="noopener nofollow" target="_blank">https://api.modrinth.com/maven&quot;)
        content {
            includeGroup("maven.modrinth")
        }
    }
}

dependencies {
    modImplementation("maven.modrinth:opc-directors-cut:${properties["opc_version"]}")
    // include this if you do not want to force your users to install the mod.
    include("maven.modrinth:opc-directors-cut:${properties["opc_version"]}")
}
</details>

Migration to 2.*

  • There are no longer any concepts of keys. Instead, you are to register an id, a Record, and a Codec.

Creating a Record

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
public record Contract(String label, boolean signed) {
public static Codec<Contract> CODEC = RecordCodecBuilder.create((instance) ->
instance.group(
Codec.STRING.fieldOf("label").forGetter(Contractlabel),
Codec.BOOL.fieldOf("signed").forGetter(Contractsigned)
).apply(instance, Contract::new)
);
}

Registering

import maven_group.modid.concept.Contract; // Контракт :)
// somewhere during static/mod initialization
private void init() {
OfflinePlayerCacheAPI.register(CONTRACT_RECORD_ID, Contract.class, Contract.CODEC, (Player player) -> {
// within this block, you decide how to translate a player's data to the Record you chose.
return new Contract(player.getName() + ":contracted", true);
});
}

Obtaining

var cache = OfflinePlayerCacheAPI.getCache(server);
cache.getEntry(Contract.class, "bibi_reden").ifPresent(contract -> {
    // we now know that there is a valid Contract entry for this player.
    // You can also use a UUID to fetch an entry as well.
});

A Special Thanks to our Sponsor


Sponsor Banner Use code "BAREMINIMUM" to get 15% off your first month!
3.0.0+1.21.1-neoforge
MC 1.21.1, NeoForge, Server
Release 2026-10-07 Get
3.0.0+1.21.1-fabric
MC Fabric, 1.21.1, Server
Release 2026-10-07 Get
2.0.0+1.21-beta.2
MC 1.21, Fabric, Quilt
Beta 2024-08-05 Get
2.0.0+1.20.1-beta.4
MC NeoForge, 1.20.1, Forge
Beta 2024-08-05 Get
2.0.0+1.20.1-beta.4
MC Fabric, 1.20.1, Quilt
Beta 2024-08-05 Get
2.0.0+1.21-beta.2
MC 1.21, NeoForge
Beta 2024-08-05 Get
2.0.0+1.20.1-beta.3
MC Fabric, 1.20.1, Quilt
Beta 2024-08-03 Get
2.0.0+1.20.1-beta.3
MC NeoForge, 1.20.1, Forge
Beta 2024-08-03 Get
2.0.0+1.21-beta.1
MC 1.21, Fabric, Quilt
Beta 2024-08-03 Get
2.0.0+1.21-beta.1
MC 1.21, NeoForge
Beta 2024-08-03 Get
2.0.0+1.20.1-beta.1~fabric
MC Fabric, 1.20.1, Quilt
Beta 2024-08-02 Get
2.0.0+1.20.1-beta.1~forge
MC NeoForge, 1.20.1, Forge
Beta 2024-08-02 Get
2.0.0+1.20.1-beta.2
MC Fabric, 1.20.1, Quilt
Beta 2024-08-02 Get
2.0.0+1.20.1-beta.2
MC NeoForge, 1.20.1, Forge
Beta 2024-08-02 Get
2.0.0+1.20.1-beta.2
MC Fabric, 1.20.1, Quilt
Beta 2024-08-02 Get
2.0.0+1.20.1-beta.2
MC NeoForge, 1.20.1, Forge
Beta 2024-08-02 Get
1.0.0+1.20.1-forge
MC NeoForge, 1.20.1, Forge
Release 2024-05-19 Get
1.0.0+1.20.1
MC NeoForge, 1.20.1, Forge
Release 2024-05-17 Get
1.0.0-beta.1+1.20.1
MC Fabric, 1.20.1, Quilt
Beta 2024-05-16 Get
1.0.0+1.20.1
MC Fabric, 1.20.1, Quilt
Release 2024-05-16 Get

More from bibireden

Advertisement Remove ads with Premium →

You Might Also Like