Skip to content

API Reference

SolWayward edited this page Mar 4, 2026 · 29 revisions

API Reference

Type: API Documentation BLGM Version: v1.3.14.11 Game Version: v1.3.14 Last Updated: 3/3/2026


Overview

This page provides a complete reference to all Bannerlord GameMaster console commands. Commands are organized into nine major categories, each addressing different aspects of game management and control.

All commands use the gm.<category>.<command> pattern and support flexible entity identification through partial names, StringIds, and the powerful query system.


Command Categories

[HERO] Hero Management

Commands: 40 | Status: STABLE

Manage individual heroes including their attributes, skills, relationships, health, and state. Control character creation, modification, appearance editing, imprisonment, and death.

View Hero Management Commands


[CLAN] Clan Management

Commands: 18 | Status: STABLE

Create and manage clans, control membership, manage resources, and handle political affiliations. Build dynasties and manage clan hierarchies.

View Clan Management Commands


[KINGDOM] Kingdom Management

Commands: 17 | Status: STABLE

Build and manage kingdoms, control diplomacy, manage clan membership, and shape the political landscape of Calradia.

View Kingdom Management Commands


[SETTLEMENT] Settlement Management

Commands: 19 | Status: STABLE

Control settlements including cities, castles, and villages. Manage properties like prosperity, loyalty, security, and hearths. Control resources, military strength, building development, and spawn NPCs and caravans.

View Settlement Management Commands


[BANDIT] Bandit Management

Commands: 4 | Status: STABLE

Control bandit parties and hideouts across Calradia. Monitor bandit populations, selectively remove parties by type, clear hideouts, and manage overall bandit presence for custom difficulty and gameplay scenarios.

View Bandit Management Commands


[CARAVAN] Caravan Management

Commands: 8 | Status: STABLE

Create and manage trade caravans across Calradia. Control caravan ownership between player, notables, and NPC lords. Count existing caravans, disband caravans by owner type, and customize the economic landscape through strategic caravan management.

View Caravan Management Commands


[TROOP] Troop Management

Commands: 7 | Status: STABLE

Add troops to hero parties, upgrade troops to higher tiers, and grant experience points for troop progression. Build balanced military forces and strengthen armies with specific troop types.

View Troop Management Commands


[ITEM] Item Management

Commands: 20 | Status: STABLE

Complete inventory and equipment control including adding items with quality modifiers, managing equipment slots, and saving/loading equipment sets.

View Item Management Commands


[QUERY] Query Commands

Commands: 18 | Status: STABLE

Advanced search and filtering system for heroes, clans, kingdoms, troops, and items. Supports complex queries with multiple filters, sorting, and detailed information display.

View Query Commands

Quick Reference Table

Category Commands Primary Use Overview Page
[HERO] Hero 40 Character management and modification API-Hero-Overview
[CLAN] Clan 18 Clan operations and membership API-Clan-Overview
[KINGDOM] Kingdom 17 Kingdom control and diplomacy API-Kingdom-Overview
[SETTLEMENT] Settlement 19 Settlement properties and resources API-Settlement-Overview
[BANDIT] Bandit 4 Bandit party and hideout control API-Bandit-Overview
[CARAVAN] Caravan 8 Trade caravan control API-Caravan-Overview
[TROOP] Troop 7 Military force management API-Troop-Overview
[ITEM] Item 20 Inventory and equipment control API-Item-Overview
[QUERY] Query 18 Search and filter entities API-Query-Overview

Total Commands: 139


Command Structure

Basic Pattern

All commands follow this structure:

gm.<category>.<command> <required_params> [optional_params]

Examples

Hero Command:

gm.hero.set_gold hero_name 5000

Clan Command:

gm.clan.add_member hero_name clan_name

Kingdom Command:

gm.kingdom.declare_war kingdom1 kingdom2

Item Command:

gm.item.add hero_name item_name --modifier masterwork --quantity 5

Query Command:

gm.query.hero --name "John" --culture empire --age>25 --sort age

Usage Conventions

Parameter Notation

Notation Meaning Example
<parameter> Required parameter <hero_id>
[parameter] Optional parameter [quantity]
--flag Optional flag --modifier
value1|value2 Choice between values male|female

Entity Identifiers

Supported Formats:

  • Full name: "Lucon of the Empire"
  • Partial name: "Lucon"
  • StringId: "lord_1_1"
  • Partial StringId: "lord_1"

Matching Behavior:

  • Case-insensitive search
  • Partial name matching supported
  • Ambiguous matches prompt for selection
  • Query commands for precise ID lookup

Parameter Types

Type Description Example
string Text value, single quotes if spaces 'Long Bow' or sword
int Whole number 100
float Decimal number 25.5
bool True or false true or false

IMPORTANT: Arguments with Spaces

The TaleWorlds console removes double quotes from arguments, so you must use single quotes for multi-word arguments:

gm.hero.create_lord male 'John Smith' empire      # Correct
gm.settlement.rename pen 'Castle of Stone'        # Correct
gm.clan.create_clan 'The Highland Clan' derthert  # Correct

Common Patterns

Finding Entities

Before using management commands, use queries to find exact IDs:

gm.query.hero lord empire
gm.query.clan battanian
gm.query.kingdom
gm.query.item sword tier>3

Entity Modification Workflow

  1. Query - Find the entity ID
  2. Verify - Check entity details
  3. Modify - Execute management command
  4. Confirm - Query again to verify changes

Example Workflow

# 1. Find hero
gm.query.hero --name "Lucon" --details

# 2. Modify hero gold
gm.hero.set_gold lord_1_1 10000

# 3. Verify change
gm.query.hero --id lord_1_1 --details

Command Categories Detail

Management Commands

Commands that modify game state:

Query Commands

Commands that search and display information:

System Commands

Commands that control mod behavior:


Advanced Features

Query System

The query system provides powerful filtering and sorting:

Multiple Filters:

gm.query.hero --culture empire --age>25 --trait brave --sort age

Boolean Logic:

gm.query.clan --tier>3 OR --renown>500

Sorting:

gm.query.kingdom --sort name
gm.query.hero --sort age --desc

Item Modifiers

Add items with specific quality levels:

gm.item.add hero_name "Long Bow" --modifier masterwork
gm.item.add hero_name "Steel Sword" --modifier legendary

Available Modifiers:

  • rusty, chipped, bent, crude, sturdy, fine, masterwork, legendary

Equipment Sets

Save and load complete equipment configurations:

gm.item.save_equipment hero_name "Knight Build"
gm.item.load_equipment hero_name "Knight Build"
gm.item.list_equipment hero_name

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