A mod that replaces Valheim’s whole interface is in everybody’s way. Inventory mods add slots, backpack mods add bags, crafting mods pull from chests, and every one of them draws its own buttons somewhere. Plenty of people who install Jatify UI already have a modpack, so it has to work alongside one. This note covers how it does that.
Rule one: step aside
The most dangerous thing a UI mod can do is fight another mod over the player’s inventory. Valheim’s inventory is a grid, and Jatify UI adds to it: extra bag rows, the Tools, Food and Meads rows, a hidden armour row, and its own way of packing all that into the save.
Two popular mods own the grid themselves: AzuExtendedPlayerInventory and ExtraSlots. ExtraSlots keeps its slots as rows at the bottom of the inventory and resizes the inventory every frame. With nothing checking for it, Jatify UI’s rows and ExtraSlots’ rows fought each other, and that can push worn gear out of the inventory, which is the kind of bug that loses someone’s gear.
So every place where Jatify UI touches the grid has a gate: if AzuExtendedPlayerInventory or ExtraSlots is installed, Jatify UI leaves the grid alone and lets that mod own it. Only once that was safe did the nicer part start: drawing ExtraSlots’ slots inside Jatify UI’s own panel and HUD, so you get one interface instead of two:
- armour and utilities on the character figure;
- quick slots and food under Tools and Food;
- ammo in a bar of its own at the bottom left;
- slots that other mods add through ExtraSlots (backpacks, jewellery, tomes, lanterns) on a Mod slots tab.
Use their buttons, not ours
Where another mod already does a job, Jatify UI calls that mod instead of doing the job a second time.
- Quick Stack Store has its own To chests, Restock and Sort. With it installed, Jatify UI’s buttons run Quick Stack Store’s actions and its own buttons are hidden. Its sort and quick stack are kept away from locked slots, worn gear and Jatify’s slot rows.
- AzuCraftyBoxes lets you craft from nearby chests. Jatify UI asks it, through its API, how many chests it can reach, and shows that count in the panel.
- Backpacks, AdventureBackpacks and RustyBags each get a tab on the inventory for every bag you wear, with the bag’s own icon. A click opens the bag. For AdventureBackpacks, Jatify UI uses that mod’s own check for what counts as a backpack, because some items look like backpacks and aren’t.
- RustyBags adds buttons to chests. They’re drawn in Jatify’s raised button look instead of Valheim’s gold, so the chest panel reads as one thing.
- Valheim Enchantment System puts Repair and Enchant on the crafting panel. Valheim’s drop area was sitting on top of them and taking the clicks, so they now live on a layer of their own.
Finding other mods without slowing the game
To check whether a mod is installed, Jatify UI looks for one of its types by name. The obvious tool for that,
Harmony’s TypeByName, walks through every type in every loaded assembly. That has two costs. It’s slow with a large
modpack, and it logs a warning for every mod that can’t load all of its own types, and again for every mod that isn’t
installed at all. With VNEI installed and Auga not, the console filled up with warnings about VNEI’s panel for Auga.
The replacement asks each assembly for the one name it needs. It does less work and logs nothing.
Telling you when something breaks
Valheim updates break mods, and when a broken mod fails inside a UI mod’s window, the UI mod tends to get the blame. Jatify UI now watches for the usual signs that a plugin was built for an older Valheim: a missing field or method, or a type that can’t start. When it sees one, it names that mod once, in the log and on screen, so you know which one to update. It also catches a mod that fails while it’s still being created, a case the first version missed.
Two other warnings come up often enough to be built in:
- A known broken mod. Sleepover is deprecated and causes trouble, so while it’s installed you get a clear warning at start to remove it.
- A screen shape that makes clicks miss. In fullscreen-window mode at a different shape than the screen, Valheim shows black bars and every click lands somewhere other than the cursor. That looks exactly like a UI bug, so Jatify UI says what’s actually happening, once.
Three times faster in big bases
Opening the inventory in a large base ran at about 10 frames a second. Developer builds of Jatify UI can log what each part of the interface costs per frame, and that log found three causes:
- The crafting card recounted materials every frame. With AzuCraftyBoxes installed, that meant asking about 27 containers what they held, about 60 ms a frame. It now recounts when you pick another recipe or amount, and otherwise once a second.
- Windows searched the scene for the settings object four times a second, 5 to 17 ms each time. They now use the one reference Valheim already keeps.
- Smelter and chest labels searched the scene on a timer. They now use Valheim’s own lists of placed pieces.
Opening the inventory in the same base went from about 10 to about 30 frames a second.
Server settings, carefully
Issue #4 asked for one set of gameplay settings for everyone on a server. Jatify UI uses ServerSync, a library that many mods include, with credit to its author. Before shipping it, its copy got a security review, and it was hardened against crafted network packets from other players. Settings only come from the server. Sizes and counts are capped. Values are only read as the type the setting expects. Each change is marked in the file, so it’s clear what differs from the original.
That has one cost, and it’s written down: when an admin changes a setting in game, other players get it the next time they join, not instantly.
Developer tools stay at home
All the tools behind this work stay out of the mod you install: the frame cost log, a test panel, a screenshot tool, a
flat test world and layout dumps. They only compile into a developer build. Before that change, every install was
quietly writing inventory layout dumps into BepInEx/cache. Now the packaging script refuses to build a release that
contains any of them.
If your modpack has a problem
The mod page has a section on running it alongside other mods, and the Discord has a pinned mod-compatibility list that’s updated with each release. If a mod you use doesn’t get along with Jatify UI, a GitHub issue with both mod names is the fastest way to get it looked at.