跳到正文

Remnant

A Minecraft library for Fabric and NeoForge that keeps registered player data accessible while players are offline.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Remnant banner

BML 1.0
Build
GitHub
CurseForge

Fabric
NeoForge

Remnant

Remnant lets mods read registered player data after a player logs out. It is a server-side library for Minecraft 1.21.1 on Fabric and NeoForge, continuing Offline Player Cache (OPC).

An integrating mod registers a value, a Mojang Codec, and a serializer for reading that value from a live player. On disconnect, Remnant snapshots every registered value into world SavedData. When the player comes back, the stale offline snapshot is removed and reads return to the live player.

Use it for leaderboards, statistics, progression, and server tools that need player data while someone is offline. Remnant stores the values registered by integrating mods.

Requirements

  • Fabric 1.21.1 — requires Fabric API and Fabric Language Kotlin
  • NeoForge 1.21.1 — requires Kotlin for Forge
  • Java 21

Install the JAR for your loader. Remnant does not add player-facing features on its own; other mods use its API.

Commands

All commands require permission level 2.

/remnant keys
/remnant players

/remnant get name <name> <key>
/remnant get uuid <uuid> <key>

/remnant list name <name>
/remnant list uuid <uuid>

/remnant remove name <name> <key>
/remnant remove uuid <uuid> <key>

/remnant clear name <name>
/remnant clear uuid <uuid>

get and list can inspect either a live player or an offline snapshot. remove and clear only modify offline cache data.

For developers

A registered value is identified by a ResourceLocation, serialized with a Mojang Codec, and produced from a live Player.

public static final PlayerLedgerKey<Contract> CONTRACT = PlayerLedger.register(
    ResourceLocation.fromNamespaceAndPath("example", "contract"),
    Contract.CODEC,
    player -> new Contract(player.getName().getString(), true)
);

Read through PlayerLedger.getPlayer(...) to get either a live LedgerPlayer.Online or a cached LedgerPlayer.Offline.

For Modrinth Maven, use the project ID so the coordinate stays stable if the public slug changes:

repositories {
    exclusiveContent {
        forRepository {
            maven("https://api.modrinth.com/maven")
        }
        filter {
            includeGroup("maven.modrinth")
        }
    }
}

dependencies {
    implementation("maven.modrinth:oLPaySSb:<version>")
}

Full API examples, source, development notes, and release history are available on the main GitHub repository.

Links

Sponsor

Sponsor Banner

Use code bareminimum to get 25% off your first month.

License

Remnant is licensed under the Bare Minimum License (BML) v1.0. See the full license.

常见问题

Remnant 支持哪些 Minecraft 版本?

Remnant 支持 Minecraft Java 版 1.20.1–1.21.1,共 8 个版本,可用的加载器:Fabric / Forge / NeoForge / Quilt。下载时注意选择和你游戏版本一致的文件。

Remnant 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Forge / NeoForge / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。

评论

登录后评论和评分

bibireden 的其他作品

查看全部 →