SimpleFabricScoreboard
SimpleFabricScoreboard 是一个轻量级的 Minecraft Fabric 库,提供了一种简单的方式来创建、更新和管理侧边计分板。
该项目专为模组开发者打造,旨在提供一个简洁实用的 API 来处理计分板逻辑,而无需直接操作 Minecraft 底层复杂的计分板机制。其目标是保持库的体积小巧、易于集成,并在实际的 Fabric 项目中方便使用。
功能介绍
SimpleFabricScoreboard 帮助你在游戏中为玩家创建侧边计分板,并支持在游戏过程中动态更新。它适用于常见的用例,例如大厅、小游戏、玩家数据统计、事件展示等场景,适合在屏幕侧面显示结构化的信息。
该库专注于提供对开发者友好的 Kotlin API 以及紧凑的工作流:
- 创建计分板
- 添加行
- 分配给特定玩家
- 后续进行更新或移除
特性
- 简单的计分板创建
- 动态行更新
- 面向 Kotlin 的整洁 API
- 按玩家管理计分板
- 基于数据包的侧边栏更新
- 轻松集成到现有的 Fabric 模组中
- 轻量级设计,开销极小
- 适用于静态和频繁变化的侧边栏
示例
val board = scoreboard("test_board", Component.literal("Test Board"), server) {
+Component.literal("Line 1")
+Component.literal("Line 2")
+emptyLine()
+Component.literal("Line 4")
line(5, Component.literal("Special Line"))
}
ScoreboardManager.setPlayerScoreboard(player, board)
board.update {
line(2, Component.literal("Updated Line 2"))
+emptyLine()
+Component.literal("Another Line")
}
SimpleFabricScoreboard
SimpleFabricScoreboard is a lightweight library for Minecraft Fabric that provides a simple way to create, update, and manage sidebar scoreboards.
The project is built for mod developers who want a clean and practical API for scoreboard handling without having to work directly with all of Minecraft's lower-level scoreboard logic. The goal is to keep the library small, easy to integrate, and straightforward to use in real Fabric projects.
What it does
SimpleFabricScoreboard helps you create sidebar scoreboards for players and update them dynamically during gameplay. It is designed for common use cases such as lobbies, minigames, player stats, event displays, and other situations where you want to show structured information on the side of the screen.
The library focuses on a developer-friendly Kotlin API and a compact workflow:
- create a scoreboard
- add lines
- assign it to a player
- update or remove it later
Features
- Simple scoreboard creation
- Dynamic line updates
- Clean Kotlin-oriented API
- Per-player scoreboard management
- Packet-based sidebar updates
- Easy integration into existing Fabric mods
- Lightweight design with minimal overhead
- Useful for both static and frequently changing sidebars
Example
val board = scoreboard("test_board", Component.literal("Test Board"), server) {
+Component.literal("Line 1")
+Component.literal("Line 2")
+emptyLine()
+Component.literal("Line 4")
line(5, Component.literal("Special Line"))
}
ScoreboardManager.setPlayerScoreboard(player, board)
board.update {
line(2, Component.literal("Updated Line 2"))
+emptyLine()
+Component.literal("Another Line")
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧