Skip to content

API Kingdom Overview

SolWayward edited this page Feb 13, 2026 · 10 revisions

[KINGDOM] Kingdom Management Commands

Category: Kingdom Management Commands: 17 commands API Version: 1.3.14.4 Status: STABLE


Overview

Kingdom management commands provide comprehensive control over the political entities and diplomatic landscape in Mount & Blade II: Bannerlord. These commands enable you to manipulate kingdom-clan relationships, manage diplomatic relations (war and peace), transfer territorial holdings (fiefs), change political leadership, and eliminate kingdoms from the game world.

Kingdoms are the highest-level political organizations in Bannerlord, encompassing multiple clans, controlling settlements (towns, castles, villages), and engaging in diplomacy and warfare. Each kingdom has a ruling clan, cultural identity, and complex diplomatic relationships with other kingdoms. The kingdom management system allows you to reshape the political map, create custom geopolitical scenarios, and test diplomatic mechanics.

All kingdom commands require campaign mode to be active. Many operations have far-reaching consequences affecting multiple clans, settlements, and diplomatic relationships simultaneously. Save file backups are strongly recommended before executing major political restructuring operations.


Command Reference

Quick Reference Table

Command Description Category Status
gm.kingdom.create_kingdom Create new kingdom with specified settlement Generation STABLE
gm.kingdom.generate_kingdoms Generate multiple kingdoms at once Generation STABLE
gm.kingdom.add_clan Add clan to kingdom Clan Management STABLE
gm.kingdom.remove_clan Remove clan from kingdom Clan Management STABLE
gm.kingdom.declare_war Declare war between kingdoms Diplomacy STABLE
gm.kingdom.make_peace Make peace between kingdoms Diplomacy STABLE
gm.kingdom.declare_alliance Form alliance between kingdoms Diplomacy STABLE
gm.kingdom.call_ally_to_war Call allied kingdom to join war Diplomacy STABLE
gm.kingdom.trade_agreement Establish trade agreement Diplomacy STABLE
gm.kingdom.pay_tribute Establish tribute payment Diplomacy STABLE
gm.kingdom.get_tribute_info Query tribute arrangements Diplomacy STABLE
gm.kingdom.rename Rename a kingdom Structure STABLE
gm.kingdom.set_ruler Change kingdom ruler Structure STABLE
gm.kingdom.equip_heroes Equip all heroes in kingdom Equipment STABLE
gm.kingdom.edit_banner Open banner editor for kingdom's ruling clan Banner STABLE
gm.kingdom.sync_vassal_banners Sync vassal clan banner colors to kingdom Banner STABLE
gm.kingdom.destroy Destroy/eliminate kingdom Structure STABLE

Note: Settlement ownership is now managed through Settlement Commands. Use gm.settlement.set_owner, gm.settlement.set_owner_clan, or gm.settlement.set_owner_kingdom instead of the deprecated give_fief commands.


Command Categories

Generation Commands

Commands for creating new kingdoms and generating multiple kingdoms at once.

gm.kingdom.create_kingdom - Creates a new kingdom with a specified settlement as the capital. A ruling clan is automatically generated, and vassal clans are created to populate the kingdom. The settlement ownership is transferred to the new ruling clan. This is ideal for creating custom kingdoms with specific names and locations.

gm.kingdom.generate_kingdoms - Generates multiple kingdoms at once by intelligently taking settlements from existing kingdoms. Alternates between kingdoms evenly, ensuring not to take any kingdom's last settlement. Perfect for fragmenting the political map or creating test scenarios with many kingdoms. All kingdom and clan names are randomly generated.

Clan Management Commands

Commands for managing kingdom membership and clan affiliations.

gm.kingdom.add_clan - Adds a clan to a kingdom, making them a vassal. If the clan is already part of another kingdom, they automatically leave that kingdom first. This is the primary method for building custom kingdom compositions and reshaping political alliances.

gm.kingdom.remove_clan - Removes a clan from their current kingdom, making them an independent faction. The clan becomes politically autonomous but loses kingdom protection and benefits. Cannot remove the ruling clan (change ruler first).

Diplomatic Relations Commands

Commands for managing diplomatic relations between kingdoms, including war, peace, alliances, trade, and tribute arrangements.

gm.kingdom.declare_war - Declares war between two kingdoms, setting them as hostile factions. This affects all clans and heroes within both kingdoms, enabling military actions, raids, and sieges. War has far-reaching effects on trade, party behavior, and AI decision-making.

gm.kingdom.make_peace - Establishes peace between two kingdoms that are currently at war, ending hostilities. Peace enables trade, diplomatic interactions, and removes combat restrictions. Kingdoms must be at war for this command to work.

gm.kingdom.declare_alliance - Forms an alliance between two kingdoms, establishing them as allied factions. Allied kingdoms support each other in wars and cannot declare war on each other while the alliance is active. Alliances affect diplomatic relations and enable military cooperation.

gm.kingdom.call_ally_to_war - Calls an allied kingdom to join a war against a target kingdom. The calling kingdom must already be at war with the target and have an active alliance with the ally kingdom being called. This causes the ally to declare war on the target.

gm.kingdom.trade_agreement - Establishes a trade agreement between two kingdoms, improving economic relations and enabling enhanced trade benefits. Trade agreements can improve relations and provide economic bonuses for both kingdoms.

gm.kingdom.pay_tribute - Establishes a tribute payment arrangement where one kingdom pays a specified daily gold amount to another kingdom. This represents diplomatic arrangements often used after wars or to maintain peace between kingdoms of unequal power.

gm.kingdom.get_tribute_info - Queries and displays all active tribute arrangements for a specified kingdom, including both tributes being paid and tributes being received. Shows amounts and involved parties for complete financial overview.

Structure Management Commands

Commands for modifying kingdom political structure.

gm.kingdom.rename - Renames a kingdom to a new name. Use single quotes for multi-word names. The name change is immediate and affects all references to the kingdom.

gm.kingdom.set_ruler - Changes the ruler of a kingdom by setting a new ruling clan. The specified hero becomes both the clan leader (if not already) and the kingdom ruler. This affects kingdom decision-making, diplomacy, and political influence.

gm.kingdom.destroy - Permanently destroys and eliminates a kingdom from the game. All settlements are transferred to other kingdoms, member clans become independent, and all diplomatic relations are ended. This action is irreversible.

Equipment Management Commands

Commands for managing equipment for all heroes across a kingdom.

gm.kingdom.equip_heroes - Equips all heroes across all clans in a kingdom with level-appropriate equipment based on their combat skills. By default only equips BLGM-created heroes to preserve native character appearances. Can optionally equip all heroes including native game characters. Equipment is culturally appropriate and weapon loadouts are derived from individual hero skills. Useful for quickly outfitting entire kingdoms after generating new lords.

Banner Management Commands

Commands for managing kingdom and clan banner colors.

gm.kingdom.edit_banner - Opens the native banner editor for the kingdom's ruling clan. This is a shortcut so you don't need to look up the ruling clan ID first. Changes made to the ruling clan's banner will propagate to the kingdom and all vassal clans.

gm.kingdom.sync_vassal_banners - Manually syncs all vassal clan banner colors back to match the kingdom's ruling clan banner colors. Useful if vassal clan banners were individually edited and you want to restore uniformity across the kingdom. WARNING: This will overwrite any custom clan banner colors for all member clans of the kingdom.


Common Parameters

Kingdom Identifier

Most commands accept flexible kingdom identification:

  • StringId - Exact game identifier (e.g., empire, vlandia, battania)
  • Partial Name - Substring match in kingdom name (e.g., emp, vland)

Clan Identifier

Commands involving clans accept:

  • StringId - Exact clan identifier (e.g., clan_empire_south_1)
  • Partial Name - Substring match in clan name

Settlement Identifier

Settlement commands require:

  • StringId - Exact settlement identifier (e.g., town_empire_1, castle_battania_2)
  • Settlement names are case-sensitive
  • Only towns and castles can be transferred

Hero Identifier

Ruler commands accept:

  • StringId - Exact hero identifier (e.g., lord_1_1)
  • Partial Name - Substring match in hero name
  • Special Keywords - player for the player character

Usage Examples

Example 1: Creating a Custom Kingdom

Create a new kingdom with a specific settlement and configuration:

gm.kingdom.create_kingdom pen 'Northern Alliance' 'House Stark' 5 vlandia,battania

Result: New kingdom created with Pen Cannoc as capital, 5 vassal clans, and custom names.

Example 2: Fragmenting the Political Map

Generate multiple kingdoms to create a more complex political landscape:

gm.kingdom.generate_kingdoms 5 3

Result: Five new kingdoms created with 3 vassals each, distributed evenly across existing kingdoms' settlements.

Example 3: Reshaping Kingdom Alliances

Transfer clans between kingdoms to create custom alliances:

gm.kingdom.add_clan clan_battania_1 empire
gm.kingdom.add_clan clan_vlandia_2 empire
gm.kingdom.remove_clan clan_empire_south_4

Result: Two clans join Empire, one becomes independent, reshaping political landscape.

Example 4: Managing Diplomatic Relations

Control wars and peace between kingdoms:

gm.kingdom.declare_war empire battania
gm.kingdom.declare_war vlandia aserai
gm.kingdom.make_peace empire vlandia

Result: New wars started, existing conflict resolved, creating complex diplomatic scenario.

Example 5: Leadership Transition

Change kingdom ruler to create succession scenarios:

gm.kingdom.set_ruler empire lord_1_2
gm.kingdom.set_ruler vlandia player

Result: New rulers take control of kingdoms, affecting policy and diplomacy.

Example 6: Kingdom Elimination

Systematically eliminate a kingdom from the game:

gm.query.kingdom_info battania
gm.kingdom.destroy battania

Result: Kingdom permanently eliminated, territories distributed, clans become independent.


Best Practices

TIP: Query Before Major Changes

Always query kingdom information before major operations:

gm.query.kingdom empire
gm.query.kingdom_info empire

This confirms kingdom identity, shows member clans, and reveals diplomatic relationships.

TIP: Manage Clan Transfers Carefully

When moving clans between kingdoms:

  • Check if clan is the ruling clan (cannot be removed)
  • Consider diplomatic implications (war status)
  • Consider existing settlement ownership

TIP: Settlement Ownership Management

For transferring settlements between kingdoms, use the Settlement Management Commands:

  • gm.settlement.set_owner_kingdom - Transfer to kingdom's ruling clan
  • gm.settlement.set_owner_clan - Transfer to specific clan
  • gm.settlement.set_owner - Transfer to specific hero's clan
  • Check settlement identifier with query commands first

TIP: War and Peace Timing

Diplomatic changes have immediate effects:

  • Declaring war enables immediate hostilities
  • Making peace stops all combat
  • Consider ongoing sieges and battles
  • Review military positions before peace

TIP: Ruler Change Requirements

When setting a new ruler:

  • Hero must be a member of the target kingdom
  • Hero's clan automatically becomes ruling clan
  • Previous ruling clan becomes normal vassal
  • Cannot remove new ruling clan after promotion

Notes & Warnings

WARNING: Kingdom Destruction is Permanent

The gm.kingdom.destroy command has irreversible consequences:

  • Kingdom is permanently eliminated
  • All settlements are transferred to other kingdoms
  • Member clans become independent factions
  • All diplomatic relations are ended
  • Player kingdom cannot be destroyed (safety restriction)

Always backup save files before kingdom destruction.

WARNING: Diplomatic Cascades

War and peace declarations can trigger unexpected consequences:

  • AI may immediately react with new wars
  • Trade routes are disrupted during war
  • Allied kingdoms may join conflicts
  • Peace may trigger AI diplomatic recalculations

WARNING: Ruling Clan Protection

Ruling clans have special protections:

  • Cannot be removed from their kingdom
  • Must change ruler first before removal
  • Attempting removal generates error

NOTE: Settlement Transfer Effects

When settlements change ownership:

  • Garrison troops remain with settlement
  • Bound villages transfer with parent settlement
  • Notables remain in settlement
  • Previous owner clan loses income
  • New owner gains full control and income

NOTE: War Effects

Kingdoms at war experience:

  • Active raiding of each other's territories
  • Siege attempts on enemy settlements
  • Interrupted trade caravans
  • Modified AI behavior (aggressive stance)
  • Relationship penalties between kingdom members

NOTE: Clan Independence

When clans are removed from kingdoms:

  • They become minor factions
  • Can still control settlements
  • May be recruited by other kingdoms
  • Lose kingdom protection and benefits
  • AI may treat them differently

Related Documentation

Command Groups

Reference Materials

User Guides


Last Updated: 2/13/2026 API Version: 1.3.14.4

Return to API Reference | Home

Quick Links

🏠 Home | Quick Reference | Syntax Guide


Hero Commands
Clan Commands
Kingdom Commands
Settlement Commands
Item Commands
Troop Commands
Caravan Commands
Bandit Commands
Query Commands

Clone this wiki locally