Wiki sections

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>.json

Place 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.

TypeValue or fields
stability−3 to +3
legitimacy, prestigeLegitimacy 0…100, prestige −100…100
treasury, debtAmount in game currency
chunks, cities, citizens (players), villagers, population (both), tax_blocksQuantity
developmentSum of development of all cities
max_unrestUnrest in the most troubled city
wars, allies, embassies (active)Quantity
overextensionShare of land without core, %
federal_taxRate, %
rank0 - principality, 1 - kingdom, 2 - empire
petitionNumber of signatures
villager_mayorsNumber of cities with a villager as mayor
country_ageAge of the country in cycles
city_unrest, city_development, city_villagers, city_chunksValue for current city or capital
lawlaw and value (true/false)
bankrupt, election, is_capital, villager_mayorvalue (true/false)
flagflag and value
goal_done, decision_takengoal or decision and value
election_readyElections are not taking place and the pause has expired
any, all, notconditions - list

Effect types

TypeFieldsResult
treasuryamount and/or percentChanges the treasury taking into account the debt limit
city_treasuryamountChanges the city treasury
stabilityamountChanges stability progress. Default 100 units - one level
legitimacy, prestigeamountChanges the point value
modifiermodifier, value, cyclesCountry modifier. Income, maintenance, cost of land and siege in percentage, unrest in points
city_modifiermodifier (unrest or tax_income), value, cyclesSingle city unrest or tax modifier
developmentamountChanges the city's development level
walletsamountChanges the balance of all citizens
rankrankSets the country rank from 0 to 2
capital—Moves the capital to the selected city
election—Triggers leader elections
set_flag, clear_flagflag, cyclesSets or clears the flag for subsequent conditions
newskeyPublishes 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

  1. Place the datapack in the datapacks world folder. Execute /reload and check that it is enabled via /datapack list.
  2. A user with operator rights can trigger an event via /politicsmod event fire <id> <country>.
  3. 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.

Original specification and default values