Change attributes of your object
set_attributesModify attributes of objects in a writable Mount & Blade II: Bannerlord module XML in place. Set or remove values via ref and optional nested path; validate schema after writing.
Instructions
Changes attributes of an object that lives in a writable module, editing the file in place. Use path to reach nested elements (mini XPath): ItemComponent/Weapon, skills/skill[@id='OneHanded'], Equipments/EquipmentRoster[1]/equipment[@slot='Item0']. For objects owned by other modules use xslt_patch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Apply to every element matched by path (default false = must match exactly one). | |
| ref | Yes | Object: Item.x, NPCCharacter.x, … or bare id. | |
| set | No | Attributes to set, e.g. {"weight": "2.5", "value": "1200"}. Values are strings. | |
| path | No | Optional path to nested element(s) inside the object. | |
| module | Yes | Writable module that defines the object. | |
| remove | No | Attribute names to remove. | |
| validate | No | Run XSD validation after writing (default true). |