管理·0.5.1
数据包
在 PoliticsMod 0.5.1 中创建您自己的事件、决策和目标。
文件夹和 ID
data/<namespace>/politicsmod/events/<name>.json
data/<namespace>/politicsmod/decisions/<name>.json
data/<namespace>/politicsmod/goals/<name>.json将文件放入 Minecraft 服务器版本的 pack.mcmeta 常规数据包中。标识符由命名空间和文件名组成,例如 mypack:harvest。内置文件位于 mod 存档中的 data/politicsmod/politicsmod/ 下。要替换嵌入文件,请重复其路径。要禁用它,请将内容替换为 {"enabled": false}。
名称和本地化
您可以传递纯文本或资源包中的密钥。默认按键为 event.<namespace>.<name>.title、.desc 和 .option.1 及以上。解决方案和目标的前缀为 decision 和 goal,结尾为 .title 和 .desc。在描述中,您可以使用 %1$s 表示国家/地区名称,使用 %2$s 表示城市名称。最好不要将它们添加到选项的标题和文本中:新闻提要显示这些行而不进行替换。
活动
mean_time 和 cooldown 被考虑在经济周期中。 once 将活动限制为每个国家一次。 city和city_conditions选择合适的城市。 options中的每个选项都可以与text和conditions一起添加。编号default_option从1开始。如果没有它,在timeout之后,最后一个选项将起作用。
{
"mean_time": 90,
"cooldown": 120,
"conditions": [{"type": "cities", "min": 1}],
"options": [
{"effects": [{"type": "treasury", "amount": 400}]},
{"effects": [{"type": "stability", "amount": 20}]}
]
}解决方案
potential 决定可见性,conditions 决定执行可能性,cost 从金库中扣除。 target_city 提供选择受 city_conditions 限制的城市。 once 将解限制为一次,cooldown 指定循环中的暂停,order 指定列表中的位置。
{
"order": 30,
"cost": 1500,
"potential": [{"type": "cities", "min": 2}],
"conditions": [{"type": "stability", "min": 0}],
"target_city": true,
"city_conditions": [{"type": "is_capital", "value": false}],
"cooldown": 200,
"effects": [{"type": "capital"}, {"type": "stability", "amount": -20}]
}目标
目标在执行 start 时启动。如果没有字段,则目标立即处于活动状态。完成conditions后,reward奖励发放一次。
{
"order": 90,
"start": [{"type": "debt", "min": 1}],
"conditions": [{"type": "debt", "max": 0}],
"reward": [{"type": "stability", "amount": 20}]
}条件类型
列表中的条件必须同时满足。数字检查使用 min、max 或 value。 "hidden": true 标志隐藏工具提示中的检查。
| 类型 | 值或字段 |
|---|---|
stability | -3 至 +3 |
legitimacy, prestige | 合法性 0…100,声望 −100…100 |
treasury, debt | 游戏币金额 |
chunks, cities, citizens (players), villagers, population (both), tax_blocks | 数量 |
development | 所有城市发展度总和 |
max_unrest | 最麻烦城市的骚乱 |
wars, allies, embassies (active) | 数量 |
overextension | 无核心土地比例,% |
federal_tax | 比率,% |
rank | 0 - 公国,1 - 王国,2 - 帝国 |
petition | 签名数量 |
villager_mayors | 村民担任市长的城市数量 |
country_age | 国家的周期年龄 |
city_unrest, city_development, city_villagers, city_chunks | 当前城市或首都的价值 |
law | law 和 value(正确/错误) |
bankrupt, election, is_capital, villager_mayor | value (true/false) |
flag | flag 和 value |
goal_done, decision_taken | goal 或 decision 和 value |
election_ready | 选举未进行且暂停已过期 |
any, all, not | conditions - 列表 |
效果类型
| 类型 | 字段 | 结果 |
|---|---|---|
treasury | amount and/or percent | 考虑债务限额更改国库 |
city_treasury | amount | 改变城市金库 |
stability | amount | 更改稳定性进度。默认 100 单位 - 一级 |
legitimacy, prestige | amount | 更改分值 |
modifier | modifier, value, cycles | 国家修正。收入、维护、土地成本和围攻百分比,动乱点数 |
city_modifier | modifier (unrest or tax_income), value, cycles | 单城市骚乱或税收修正 |
development | amount | 改变城市发展水平 |
wallets | amount | 改变所有公民的余额 |
rank | rank | 设置国家排名从 0 到 2 |
capital | — | 迁都至所选城市 |
election | — | 触发领导人选举 |
set_flag, clear_flag | flag, cycles | 设置或清除后续条件的标志 |
news | key | 在新闻中发布条目 |
城市影响适用于事件或决策所在的城市。如果没有选择城市,则使用首都。
加载与调试
- 将数据包放入
datapacks世界文件夹中。执行/reload并检查是否通过/datapack list启用。 - 具有操作员权限的用户可以通过
/politicsmod event fire <id> <country>触发事件。 - 如果某个文件被跳过,服务器日志将指示 ID 和原因。例如,检查效果类型和 JSON 结构中的拼写错误。