中土世界新增内容:阵营
? 概览
Middle-Earth Additions: Factions 是一款功能强大的 Middle-Earth 模组附加组件,可自动追踪玩家的阵营归属,并提供与 PlaceholderAPI 兼容模组的无缝集成。非常适合希望在聊天、前缀及其他 UI 元素中显示阵营信息的服务器。
✨ 特性
? 自动阵营追踪
? PlaceholderAPI 集成
? 标题菜单(新增)
-
打开方式:在游戏中按默认绑定键 O 打开“阵营标题菜单”。你可以在“控制”下的“Middle Earth Additions”类别中重新绑定此按键。
-
阵营面板:紧凑的面板显示你当前的阵营图标和五个头衔节点。
-
善/恶变体:菜单会根据你的阵营倾向(善/恶)进行调整,改变按钮图标和等级名称(例如:士兵→骑士→队长→男爵→领主 vs 战士→乌鲁克→酋长→将军→霸主)。
-
线性进度:解锁必须按顺序获得。尝试预览或解锁后续节点会显示前置条件提示。
-
要求与反馈:工具提示显示银币、金币和经验等级要求,并以颜色编码状态显示。资源不足或缺少前置条件会通过操作栏消息显示。
-
阵营图标:左上角的阵营按钮显示适合该阵营的物品(例如:刚铎盾牌、魔多木盾等)。
-
已解锁增益列表:已解锁等级的增益效果列在面板中(示例:10% 速度提升、+0.5 箭矢伤害、+1 颗心、抗性光环)。
? 玩家指令
-
切换显示:玩家可以控制其阵营是否在聊天中显示
-
测试工具:内置命令用于调试和测试占位符功能
?️ 开发者 API
? 需求
必需依赖
可选依赖
? 安装
-
安装 Fabric Loader 和 Fabric API
-
安装 Middle-Earth 模组
-
下载并将此模组放入你的 mods 文件夹
-
(可选)安装 PlaceholderAPI 以增强兼容性
-
启动你的服务器/世界
? 可用占位符
基础占位符
| 占位符 |
描述 |
示例输出 |
| %mefaction% |
格式化后的阵营名称 |
Gondor |
| %mefaction_full% |
完整阵营标识符 |
me:gondor |
| %mefaction_display% |
带阵营的名称(如果启用) |
[Gondor] PlayerName |
| %metitle% |
玩家头衔名称 |
Soldier |
支持的阵营
所有 Middle-Earth 模组的阵营均支持并正确格式化:
| 阵营 ID |
显示名称 |
| me:gondor |
Gondor |
| me:rohan |
Rohan |
| me:dale |
Dale |
| me:longbeards |
Longbeards |
| me:longbeards.erebor |
Erebor |
| me:lothlorien |
Lothlórien |
| me:mordor |
Mordor |
| me:misty_mountains_goblins |
Misty Mountains |
| me:isengard |
Isengard |
| me:shire |
Shire |
| me:bandit |
Bandit |
? 使用示例
StyledChat 集成
{
"chat": {
"format": "<%mefaction% {player_name}> {message}"
}
}
结果:<Gondor PlayerName> Hello everyone!
LuckPerms 前缀
/lp user PlayerName meta setprefix 100 "%mefaction% "
结果:玩家显示为 Gondor PlayerName
自定义聊天格式化
{
"style": {
"chat": "[%mefaction%] %player% » %message%"
}
}
结果:[Gondor] PlayerName » Hello Middle-earth!
? 指令
玩家指令
管理员指令
-
/viewfactiondata - 查看所有已存储的阵营数据
-
列出所有玩家及其阵营
-
显示总玩家数
-
/exportfactiondata - 显示阵营数据文件位置
-
显示 JSON 存储文件的路径
-
显示当前存储统计信息
-
/testfactionplaceholder - 测试占位符功能
-
服务器管理员的调试工具
-
显示玩家的所有可用占位符
-
显示当前切换状态
? 数据存储
阵营数据会自动保存到 [world]/faction_data.json:
{
"player-uuid-here": {
"playerId": "player-uuid",
"playerName": "PlayerName",
"disposition": "good",
"factionId": "me:gondor",
"spawnId": "me:gondor.minas_tirith",
"timestamp": 1672531200000
}
}
数据字段
? 兼容性
已测试兼容性
?️ 配置
本模组设计为无需任何配置即可使用。所有设置会根据你安装的 Middle-Earth 模组自动检测和配置。
自定义选项
? 许可证
本模组依据「保留所有权利」许可证发布。详情请参阅 LICENSE 文件。
? 致谢
-
Middle-Earth Mod - 提供了令人惊叹的中土世界体验
-
PlaceholderAPI - 提供了出色的占位符系统
-
Fabric Community - 提供了模组开发框架和工具
祝你在中土世界的冒险愉快!?♂️⚔️?
Middle-Earth Additions: Factions
? Overview
Middle-Earth Additions: Factions is a powerful addon for the Middle-Earth mod that automatically tracks player faction affiliations and provides seamless integration with PlaceholderAPI-compatible mods. Perfect for servers wanting to display faction information in chat, prefixes, and other UI elements.
✨ Features
? Automatic Faction Tracking
-
Real-time Detection: Automatically detects when players join factions in the Middle-Earth mod
-
Persistent Storage: Stores faction data as JSON files in your world save directory
-
Zero Configuration: Works out of the box with no additional setup required
? PlaceholderAPI Integration
-
Universal Compatibility: Works with StyledChat, LuckPerms, and any mod supporting PlaceholderAPI
-
Multiple Placeholders: Provides various placeholder formats for different use cases
-
Optional Dependency: Functions independently but enhances with PlaceholderAPI present
? Title Menu (New)
-
How to Open: Press the default keybinding O to open the Faction Title Menu while in-game. You can rebind this in Controls under category “Middle Earth Additions”.
-
Faction Panel: A compact panel shows your current faction icon and five title nodes.
-
Good/Evil Variants: The menu adapts to your disposition (good/evil), changing button icons and rank names (e.g., Soldier→Knight→Captain→Baron→Lord vs Warrior→Uruk→Chieftain→General→Overlord).
-
Linear Progression: Unlocks must be earned in order. Attempting to preview or unlock a later node shows a prerequisite message.
-
Requirements & Feedback: Tooltips display Silver Coin, Gold Coin, and EXP level requirements with color-coded status. Insufficient resources or missing prerequisites are shown via action bar messages.
-
Faction Icon: The top-left faction button displays a faction-appropriate item (e.g., Gondorian Shield, Mordor Wooden Shield, etc.).
-
Unlocked Perks List: Perks for unlocked ranks are listed in the panel (examples: 10% Speed Boost, +0.5 Arrow Damage, +1 Heart, Resistance aura).
? Player Commands
?️ Developer API
-
Public API: Clean interface for other mods to access faction data
-
Type Safety: Proper null handling and error management
-
Documentation: Comprehensive JavaDoc and usage examples
? Requirements
Required Dependencies
Optional Dependencies
-
PlaceholderAPI: 2.4.0+ (for enhanced placeholder support)
-
StyledChat: For chat formatting integration
-
LuckPerms: For permission-based prefix/suffix integration
? Installation
-
Install Fabric Loader and Fabric API
-
Install the Middle-Earth mod
-
Download and place this mod in your mods folder
-
(Optional) Install PlaceholderAPI for enhanced compatibility
-
Start your server/world
? Available Placeholders
Basic Placeholders
| Placeholder |
Description |
Example Output |
| %mefaction% |
Formatted faction name |
Gondor |
| %mefaction_full% |
Full faction identifier |
me:gondor |
| %mefaction_display% |
Name with faction (if enabled) |
[Gondor] PlayerName |
| %metitle% |
Player title name |
Soldier |
Supported Factions
All Middle-Earth mod factions are supported with proper formatting:
| Faction ID |
Display Name |
| me:gondor |
Gondor |
| me:rohan |
Rohan |
| me:dale |
Dale |
| me:longbeards |
Longbeards |
| me:longbeards.erebor |
Erebor |
| me:lothlorien |
Lothlórien |
| me:mordor |
Mordor |
| me:misty_mountains_goblins |
Misty Mountains |
| me:isengard |
Isengard |
| me:shire |
Shire |
| me:bandit |
Bandit |
? Usage Examples
StyledChat Integration
{
"chat": {
"format": "<%mefaction% {player_name}> {message}"
}
}
Result: <Gondor PlayerName> Hello everyone!
LuckPerms Prefix
/lp user PlayerName meta setprefix 100 "%mefaction% "
Result: Player appears as Gondor PlayerName
Custom Chat Formatting
{
"style": {
"chat": "[%mefaction%] %player% » %message%"
}
}
Result: [Gondor] PlayerName » Hello Middle-earth!
? Commands
Player Commands
-
/togglefaction - Toggle faction display in your name
-
Shows your current faction status
-
Provides preview of how your name will appear
Administrator Commands
-
/viewfactiondata - View all stored faction data
-
Lists all players and their factions
-
Shows total player count
-
/exportfactiondata - Show faction data file location
-
Displays path to JSON storage file
-
Shows current storage statistics
-
/testfactionplaceholder - Test placeholder functionality
-
Debug tool for server administrators
-
Shows all available placeholders for a player
-
Displays current toggle state
? Data Storage
Faction data is automatically saved to [world]/faction_data.json:
{
"player-uuid-here": {
"playerId": "player-uuid",
"playerName": "PlayerName",
"disposition": "good",
"factionId": "me:gondor",
"spawnId": "me:gondor.minas_tirith",
"timestamp": 1672531200000
}
}
Data Fields
-
playerId: Unique player identifier
-
playerName: Current player name
-
disposition: Faction alignment (good/evil/neutral)
-
factionId: Full faction identifier from Middle-Earth mod
-
spawnId: Associated spawn location
-
timestamp: Last update time in milliseconds
? Compatibility
Tested Compatibility
-
✅ StyledChat - Full chat formatting support
-
✅ LuckPerms - Prefix/suffix integration
-
✅ TAB - Scoreboard and tablist integration
-
✅ MiniMOTD - Server MOTD placeholders
?️ Configuration
This mod is designed to work with zero configuration. All settings are automatically detected and configured based on your Middle-Earth mod installation.
Customization Options
-
Player toggle states are preserved across server restarts
-
Faction name formatting can be customized via the API
-
JSON data location is tied to world saves for multi-world support
? License
This mod is released under the All Rights Reserved License. See LICENSE file for details.
? Credits
-
Middle-Earth Mod - For providing the amazing Middle-earth experience
-
PlaceholderAPI - For the excellent placeholder system
-
Fabric Community - For the modding framework and tools
Happy adventuring in Middle-earth! ?♂️⚔️?
评论 0
登录后参与评分
还没有评论,来抢沙发吧