A free mod for Mount & Blade II: Bannerlord, by ThisIsSovereign.
The goal of this mod is to prevent clans from defecting from or leaving the player’s kingdom, unless the leader’s relationship with the player is low (threshold is configurable). I got tired of clan leaders I had a positive relationship with, or had given fiefs to etc, still defecting from my Kingdom.
The way this is achieved is by adding a patch to the methods used in the game. There are three methods that must be added: ConsiderDefection, ConsiderClanLeaveKingdom, and DiplomaticBartersBehaviors. These methods prevent the clan from leaving the player’s kingdom, unless the leader’s relationship with the player is low.