Millénaire KubeJS
Millénaire KubeJS connects Millénaire to KubeJS so you can tune villages to fit your modpack. Change what villagers produce, what shops buy and sell, which tools villagers use, or how much material a building takes.
The addon provides the API, and your scripts set the rules. You can add an offer to the village chief's menu, set its price and reputation requirement, and decide what happens when a player buys it.
For Minecraft 1.21.1 on NeoForge.
Requirements: Millénaire 9.1.0, KubeJS 2101.7.2, and Rhino.
EXAMPLE FOR MODPACK AUTHORS
Say you want the chief of a Norman farming village to sell an expansion that gives the village more room to build.
Save this script as:
kubejs/startup_scripts/millenaire/village_expansion.js
You can keep your other Millénaire startup scripts in the same millenaire folder.
const expansionId = 'farming_village_expansion'
MillenaireEvents.content(event => { event.chiefOffer( 'norman', 'agricole', expansionId, 'Expand the village', 2048, // Price in deniers 256 // Required reputation )})
MillenaireEvents.chiefPurchase(event => { if (event.offerId() === expansionId) { event.expandRadiusBy(32) }})
Restart the game or dedicated server to load the script.
The offer will appear in the chief's menu. Buying it increases that village's building radius by 32 blocks and saves the new radius with the village.
OTHER FEATURES
production() - Change a villager's production recipes.
shop() and tradeGood() - Configure village trading.
villager() - Change villager settings.
buildingCost() - Set the materials required to construct a building.
CUSTOM BUILDINGS
To add your own building:
1. Place its exported .nbt file in kubejs/millenaire_templates/.
2. Register the building using template().
3. Use offerConstructionProject() to add it to the Summoning Wand menu in a player-controlled village.

