Scoreboard ID
一个 Minecraft 数据包,为每位玩家分配唯一的 9 位数字 ID,便于在多人服务器上进行玩家识别与管理。
功能特性
- 自动分配 ID:每位玩家加入服务器时会自动获得一个唯一的 9 位数字 ID(范围:100000000-999999999)
- 冲突解决:内置检测与解决机制,确保没有任何两位玩家共享相同的 ID
- 玩家查找:可通过 ID 查找玩家,或查看所有玩家的 ID
- 交互式对话框系统:提供用户友好的界面,包含帮助菜单与支持选项
- 易于使用的命令:基于触发器(trigger)的简单命令,可快速访问 ID 信息
要求
- Minecraft Java Edition 1.21.9 或更高版本
- 数据包格式版本 88-107
- Server Tools 依赖项(自动加载)
安装方法
-
下载数据包文件
-
将其放入世界的 datapacks 文件夹中:
<world_folder>/datapacks/Scoreboard ID - 1.21.9+.zip
-
在游戏中重载数据包:
/reload
-
数据包将自动初始化,并为所有在线玩家分配 ID
使用方法
查看自己的 ID
/trigger score_id.self_id set 1
在聊天栏显示你的个人 9 位数字 ID。
查看所有玩家的 ID
/trigger score_id.show_all set 1
显示所有当前在线玩家的 ID。
按 ID 查找玩家
/trigger score_id.show_player set <ID>
将 <ID> 替换为一个 9 位数字,以查找该 ID 对应的玩家。
示例:
/trigger score_id.show_player set 123456789
访问帮助菜单
打开暂停菜单,导航至 Server Tools 菜单,即可访问包含所有可用命令的帮助对话框。
技术细节
记分板目标(Scoreboard Objectives)
该数据包会创建以下记分板目标:
score_id(dummy):存储每位玩家的唯一 9 位数字 ID
score_id.self_id(trigger):用于查看自己 ID 的触发器
score_id.show_all(trigger):用于查看所有玩家 ID 的触发器
score_id.show_player(trigger):用于通过 ID 查找玩家的触发器
ID 生成规则
- ID 在以下范围内随机生成:
100000000 至 999999999
- 自动冲突检测确保 ID 的唯一性
- 若检测到冲突,系统将重新分配一个新的随机 ID
文件结构
Scoreboard ID - 1.21.9+/
├── pack.mcmeta # 数据包元数据
├── spyglass.json # Spyglass IDE 配置文件
└── data/
├── minecraft/
│ └── tags/
│ ├── dialog/ # 用于 Server Tools 集成的对话框标签
│ └── function/ # 函数标签
└── score_id/
├── dialog/ # 对话框定义
│ ├── help/ # 帮助菜单对话框
│ ├── support/ # 支持对话框
│ └── main_menu.json # 主菜单配置
└── function/ # 函数文件
├── init.mcfunction # 初始化函数
├── id.mcfunction # ID 分配逻辑
└── show_id/ # ID 显示函数
├── show_all_id.mcfunction
├── show_id_self.mcfunction
└── show_player_name.mcfunction
命令参考
| 命令 |
描述 |
类型 |
/trigger score_id.self_id set 1 |
显示你自己的 ID |
Trigger |
/trigger score_id.show_all set 1 |
显示所有在线玩家的 ID |
Trigger |
/trigger score_id.show_player set <ID> |
根据 ID 查找玩家 |
Trigger |
开发者指南
依赖项
此数据包需要 Server Tools 框架支持:
- 通过
#server_tools_init 函数标签自动加载
- 与 Server Tools 菜单系统集成
自定义设置
你可以修改以下内容:
- ID 范围:编辑
data/score_id/function/id.mcfunction 以更改 ID 范围
- 消息内容:修改函数文件中的 tellraw 消息
- 对话框 UI:自定义
data/score_id/dialog/ 中的对话框 JSON 文件
作者
FeSo4a
许可证
本项目为开源项目。欢迎根据你的需求自由使用、修改和分发。
Bug 报告与支持
如果你遇到任何问题或有建议:
- 检查游戏内的帮助菜单:使用
/trigger 命令或打开暂停菜单
- 通过上述平台联系作者
- 在 GitHub 上提交 Issue
享受使用 Scoreboard ID 管理你的服务器!
Scoreboard ID
A Minecraft datapack that assigns a unique 9-digit ID to each player, enabling easy player identification and management on multiplayer servers.
Features
- Automatic ID Assignment: Each player receives a unique 9-digit ID (100000000-999999999) automatically upon joining
- Conflict Resolution: Built-in detection and resolution system ensures no two players share the same ID
- Player Lookup: Find players by their ID or view all player IDs
- Interactive Dialog System: User-friendly interface with help menus and support options
- Easy-to-Use Commands: Simple trigger-based commands for quick access to ID information
Requirements
- Minecraft Java Edition 1.21.9 or higher
- Datapack format version 88-107
- Server Tools dependency (automatically loaded)
Installation
-
Download the datapack file
-
Place it in your world's datapacks folder:
<world_folder>/datapacks/Scoreboard ID - 1.21.9+.zip
-
Reload datapacks in-game:
/reload
-
The datapack will automatically initialize and assign IDs to all online players
Usage
View Your Own ID
/trigger score_id.self_id set 1
Displays your personal 9-digit ID in chat.
View All Players' IDs
/trigger score_id.show_all set 1
Shows the ID of all currently online players.
Find Player by ID
/trigger score_id.show_player set <ID>
Replace <ID> with a 9-digit number to find which player owns that ID.
Example:
/trigger score_id.show_player set 123456789
Access Help Menu
Open the pause menu and navigate to the Server Tools menu to access the help dialog with all available commands.
Technical Details
Scoreboard Objectives
The datapack creates the following scoreboard objectives:
score_id (dummy): Stores each player's unique 9-digit ID
score_id.self_id (trigger): Trigger for viewing your own ID
score_id.show_all (trigger): Trigger for viewing all players' IDs
score_id.show_player (trigger): Trigger for looking up players by ID
ID Generation
- IDs are randomly generated within the range:
100000000 to 999999999
- Automatic conflict detection ensures uniqueness
- If a conflict is detected, a new random ID is assigned
File Structure
Scoreboard ID - 1.21.9+/
├── pack.mcmeta # Datapack metadata
├── spyglass.json # Spyglass IDE configuration
└── data/
├── minecraft/
│ └── tags/
│ ├── dialog/ # Dialog tags for server tools integration
│ └── function/ # Function tags
└── score_id/
├── dialog/ # Dialog definitions
│ ├── help/ # Help menu dialogs
│ ├── support/ # Support dialogs
│ └── main_menu.json # Main menu configuration
└── function/ # Function files
├── init.mcfunction # Initialization function
├── id.mcfunction # ID assignment logic
└── show_id/ # ID display functions
├── show_all_id.mcfunction
├── show_id_self.mcfunction
└── show_player_name.mcfunction
Commands Reference
| Command |
Description |
Type |
/trigger score_id.self_id set 1 |
Display your own ID |
Trigger |
/trigger score_id.show_all set 1 |
Display all online players' IDs |
Trigger |
/trigger score_id.show_player set <ID> |
Find player by their ID |
Trigger |
For Developers
Dependencies
This datapack requires the Server Tools framework:
- Automatically loads via
#server_tools_init function tag
- Integrates with the server tools menu system
Customization
You can modify the following aspects:
- ID Range: Edit
data/score_id/function/id.mcfunction to change the ID range
- Messages: Modify tellraw messages in the function files
- Dialog UI: Customize dialog JSON files in
data/score_id/dialog/
Author
FeSo4a
License
This project is open-source. Feel free to use, modify, and distribute according to your needs.
Bug Reports & Support
If you encounter any issues or have suggestions:
- Check the help menu in-game:
/trigger commands or pause menu
- Contact the author through the platforms listed above
- Submit an issue on GitHub
Enjoy managing your server with Scoreboard ID!
评论 0
登录后参与评分
还没有评论,来抢沙发吧