管理·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 結構中的拼字錯誤。