Offline Player Cache

Offline Player Cache

Allows mods to cache serverside player data when offline.

by
2.8K Downloads
fabriclibraryutility
Rent Server with this Mod

About this Mod

What is Offline Player Cache?

Offline Player Cache (OPC) is a Minecraft API mod built using the Fabric framework to allow caching player data on the server while the player is offline. This means that mods can use this API to access offline player's data. This was primarily developed as a way to allow global and persistent leaderboards for Minecraft servers that included offline players.

Specific Capabilities

Mods can register functions that take in a player and output a value/object; this value/object is limited only by what is specified in the key's read/write to/from nbt data. When a player disconnects from a server, all registered functions are called and the respective data is cached on the server before the player disconnects. This data is saved to the server's level data, and can be accessed any time. When the same player connects to the server, their cached data is deleted and instead when a value function is called, it returns the current value/object based on the online player.

Commands

  • /opc get uuid|name <uuid|name> <key> Returns the input uuid/name player's value; if they are online, returns their current value, if they are offline returns their cached value; else returns null. If the value is an instanceof Number and run from a command block, the redstone output is the absolute modulus of 16.
  • /opc remove uuid|name <uuid|name> <key> If the input uuid/name player is offline, removes that player's cached value determined by the input key; if the player is online, does nothing.
  • /opc remove uuid|name <uuid|name> If the input uuid/name player is offline, removes all of their cached data; if the player is online, does nothing.

Notes

  • This API mod does not itself register any cacheable values, and hence does not cache any player data, and therefore does nothing by itself.
  • To use this API in your mod, you can include the following in your gradle build (see Modrinth Maven for more details):
repositories {
    maven {
        name = "Modrinth"
        url = "https://api.modrinth.com/maven"
        content {
            includeGroup "maven.modrinth"
        }
    }
}
dependencies {
    modImplementation "maven.modrinth:offline-player-cache:<version>"
    include "maven.modrinth:offline-player-cache:<version>"
}

Available Versions

0.6.4beta
MC 1.19.2fabric
August 28, 2022
0.6.3beta
MC 1.19fabric
August 28, 2022
0.5.2beta
MC 1.18.2fabric
August 28, 2022
0.6.2beta
MC 1.19.2fabric
August 6, 2022
0.6.1beta
MC 1.19fabric
July 29, 2022

How to Install Offline Player Cache on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.19.2).

3

Install Mod

Open the mod browser in the dashboard and search for "Offline Player Cache". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.19.2, 1.19, 1.18.2

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Offline Player Cache server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.19.2). You can switch loaders with one click in the panel.

Is Offline Player Cache compatible with fabric?

Offline Player Cache officially supports fabric for Minecraft 1.19.2, 1.19, 1.18.2. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Offline Player Cache – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Offline Player Cache consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Offline Player Cache with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
MIT License
Server-side
Required

Supported Versions

1.19.21.191.18.2