Heads up: I made this with AI (Claude). I told it what I needed, it wrote the code, and I tested it in my own pack. It works there, but read the details before you throw it in yours.
What it does
GeckoJS 1.6.0 still calls a KubeJS method called Item.kjs$getItemBuilder(). The newer KubeJS 2101.7.2 builds took that method out. So if you run both, the game crashes the second a GeckoJS item gets drawn: holding it, dropping it, opening your inventory, even a shader shadow pass. You get this:
java.lang.NoSuchMethodError: 'dev.latvian.mods.kubejs.item.ItemBuilder net.minecraft.world.item.Item.kjs$getItemBuilder()'
This mod just puts that one method back. When GeckoJS asks for an item's builder, it finds it in KubeJS's own registry and hands it back. That's it.
Also fixes a world-load freeze with Renri's Quest Board (new in 1.0.1)
If you run Renri's Quest Board 1.0.3 with Twilight Forest, your world can get stuck at 100% on the loading screen forever. It doesn't happen every time, only when you logged out far from 0,0, which makes it really annoying to track down. What's going on: when the world starts, Quest Board makes a test copy of every mob to read its loot, then deletes it. Deleting the Twilight Forest Lich runs its cleanup code, which tries to light candles at 0,0, which tries to load that chunk in the middle of the server tick, and the game just waits forever.
This mod skips that delete for the test copies. They were never in the world anyway, so nothing else changes and the quest boards work like normal. No Quest Board installed? This part doesn't load.
Also fixes a raid freeze with Range's Settlements (new in 1.0.7)
Range's raid timer looked up each settlement's banner even when that chunk wasn't loaded. That force-loads the chunk in the middle of the tick and can lock the server up. Now it just skips settlements that aren't loaded. No Range's Settlements? This part doesn't load.
Also fixes a worldgen freeze with Quality Food (new in 1.0.7)
This one froze my game every time I teleported far. When a structure spawns a mob during worldgen (like a pillager), Musket Mod picks its gun from a loot table, and Quality Food's loot modifier then tries to read the world from the worldgen thread. The server ends up waiting on itself forever. Now Quality Food skips its quality roll when it's not on the main server thread. Worldgen loot just doesn't get a quality tag, everything else works like normal. I teleported around a bunch of times after this and never froze again.
Wandering maid stock fix (new in 1.0.7)
Small fix for Touhou Little Maid's wandering maid traders so their stock works right.
KDM talk / trade window (new in 1.0.7)
A Without Honor style dialogue window that works on any entity: villagers, Range's settlers, bosses, whatever. KubeJS scripts open it with a speaker name, some text, a portrait of the entity and a list of buttons. It works with a controller (Controlify) and keyboard, and Enter presses the button you have selected. My pack uses it for settlement shops and nemesis raid choices. It also carries the Survivor's Almanac guide book for my pack.
Why not just patch GeckoJS
I didn't want to pass around an edited copy of somebody else's mod. This way GeckoJS and KubeJS stay untouched and you can still update them like normal.
It turns itself off if it's not needed
On startup it checks if your KubeJS already has the method. If it does (an older KubeJS, or if they add it back later), the bridge doesn't load, and your log says which one happened under [KDM Compat]. If GeckoJS updates and stops calling the old method, this just sits there and does nothing. Safe to leave in.
What you need
- Minecraft 1.21.1
- NeoForge 21.1 or newer
- KubeJS 2101.7.x
- GeckoJS is optional, the bridge only kicks in if it's there
- Range's Settlements, Quality Food and Touhou Little Maid are optional too, each fix only loads if its mod is there
- Renri's Quest Board is optional, the freeze fix only kicks in if it's there
- Goes on client and server, same as GeckoJS
What I tested
Tested in my Kingdom Death Minecraft pack (about 500 mods) with KubeJS 2101.7.2 build 381, GeckoJS 1.6.0 and NeoForge 21.1.268. Before this, a GeckoJS sword crashed the game the moment it showed up in my hotbar. With it, the item draws fine and there are zero kjs$getItemBuilder errors in the log. For the Quest Board fix, my test world froze at 100% every single time (I was about 1,200 blocks from 0,0). With 1.0.1 it loads right in.
How it works (for the nerds)
One mixin on net.minecraft.world.item.Item adds kjs$getItemBuilder(). It searches KubeJS's item registry storage for the builder whose item matches, then caches it. Before applying, a mixin config plugin reads KubeJS's ItemKJS and ItemMixin classes and skips the whole thing if the method's already there. 1.0.1 adds a second mixin on Quest Board's QuestData$ScannedMob that redirects the discard() call in lootReward to do nothing. The same plugin only applies it if Quest Board's class is actually there.
Other stuff
Nothing in here is specific to my pack, so it should work anywhere with the same versions. The source code is inside the jar in /source, MIT license, do what you want with it. If it breaks something, let me know in the comments and I'll look at it.