It seems I have managed to wiggle through all the hoops, now the window seems working, only it doesn't have all the callbacks, so I'm adding that.
Not sure yet if OnSlotChange callback is viable for all slots, I'm afraid it's gonna be difficult and I may need to implement it so that it gets called only for the Lua-handled slots (not in the player armor, inventory nor hotbar), at least for the time being.
Pure evil! The OnClosing callback can refuse to close the window The player can't do anything then, other than quit MC altogether.
Not sure yet if OnSlotChange callback is viable for all slots, I'm afraid it's gonna be difficult and I may need to implement it so that it gets called only for the Lua-handled slots (not in the player armor, inventory nor hotbar), at least for the time being.
Pure evil! The OnClosing callback can refuse to close the window The player can't do anything then, other than quit MC altogether.