Administration · 0.5.1
Datapacks
Create your own events, decisions and goals in PoliticsMod 0.5.1.
Folders and IDs
data/<namespace>/politicsmod/events/<name>.json
data/<namespace>/politicsmod/decisions/<name>.json
data/<namespace>/politicsmod/goals/<name>.jsonPlace the files in a regular datapack with pack.mcmeta for the Minecraft server version. The identifier consists of the namespace and the file name, for example mypack:harvest. The built-in files are located under data/politicsmod/politicsmod/ in the mod archive. To replace an embedded file, repeat its path. To disable it, replace the content with {"enabled": false}.
Names and localization
You can pass plain text or a key from a resource pack. The default keys are event.<namespace>.<name>.title, .desc and .option.1 and onwards. Solutions and goals have the prefixes decision and goal, with the endings .title and .desc. In descriptions, you can use %1$s for the name of the country and %2$s for the city. It is better not to add them to the headings and texts of options: the news feed shows these lines without substitutions.
Event
mean_time and cooldown are considered in economic cycles. once limits the event to one time per country. city and city_conditions select the appropriate city. Each option in options can be added with text and conditions. The numbering default_option starts from 1. Without it, after timeout, the last option will work.
{
"mean_time": 90,
"cooldown": 120,
"conditions": [{"type": "cities", "min": 1}],
"options": [
{"effects": [{"type": "treasury", "amount": 400}]},
{"effects": [{"type": "stability", "amount": 20}]}
]
}Solution
potential determines visibility, conditions determines the possibility of execution, and cost is debited from the treasury. target_city offers to select a city limited by city_conditions. once limits the solution to one time, cooldown specifies a pause in the cycles, order specifies the position in the list.
{
"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}]
}Target
The target starts when start is executed. If there is no field, the target is active immediately. After completing conditions, the reward reward is issued once.
{
"order": 90,
"start": [{"type": "debt", "min": 1}],
"conditions": [{"type": "debt", "max": 0}],
"reward": [{"type": "stability", "amount": 20}]
}Condition types
The conditions in the list must be satisfied simultaneously. Numeric checks use min, max or value. The "hidden": true flag hides the check from the tooltip.
| Type | Value or fields |
|---|---|
stability | −3 to +3 |
legitimacy, prestige | Legitimacy 0…100, prestige −100…100 |
treasury, debt | Amount in game currency |
chunks, cities, citizens (players), villagers, population (both), tax_blocks | Quantity |
development | Sum of development of all cities |
max_unrest | Unrest in the most troubled city |
wars, allies, embassies (active) | Quantity |
overextension | Share of land without core, % |
federal_tax | Rate, % |
rank | 0 - principality, 1 - kingdom, 2 - empire |
petition | Number of signatures |
villager_mayors | Number of cities with a villager as mayor |
country_age | Age of the country in cycles |
city_unrest, city_development, city_villagers, city_chunks | Value for current city or capital |
law | law and value (true/false) |
bankrupt, election, is_capital, villager_mayor | value (true/false) |
flag | flag and value |
goal_done, decision_taken | goal or decision and value |
election_ready | Elections are not taking place and the pause has expired |
any, all, not | conditions - list |
Effect types
| Type | Fields | Result |
|---|---|---|
treasury | amount and/or percent | Changes the treasury taking into account the debt limit |
city_treasury | amount | Changes the city treasury |
stability | amount | Changes stability progress. Default 100 units - one level |
legitimacy, prestige | amount | Changes the point value |
modifier | modifier, value, cycles | Country modifier. Income, maintenance, cost of land and siege in percentage, unrest in points |
city_modifier | modifier (unrest or tax_income), value, cycles | Single city unrest or tax modifier |
development | amount | Changes the city's development level |
wallets | amount | Changes the balance of all citizens |
rank | rank | Sets the country rank from 0 to 2 |
capital | — | Moves the capital to the selected city |
election | — | Triggers leader elections |
set_flag, clear_flag | flag, cycles | Sets or clears the flag for subsequent conditions |
news | key | Publishes an entry in the news |
City effects are applied to the city of the event or decision. Without a city selected, the capital is used.
Loading and Debugging
- Place the datapack in the
datapacksworld folder. Execute/reloadand check that it is enabled via/datapack list. - A user with operator rights can trigger an event via
/politicsmod event fire <id> <country>. - If a file is skipped, the server log will indicate the ID and reason. For example, check for typos in the effect type and JSON structure.