Started by
Memebassador
on
Topic category: Help with Minecraft modding (Java Edition)
Is there a way to override vanilla GUIs with a custom one? I inquired about this here (https://mcreator.net/comment/251098) but no luck as of yet. Figured I should make an entire topic for the question. My ultimate goal is to overhaul the Enchanting Table as I cannot wrap my head around recreating the book on top of it with Blockbench. If overriding GUIs is impossible but you have tips on how to recreate the Enchanting Table in Blockbench from scratch, I'm all ears. Thanks.
Edited by Memebassador on Fri, 08/09/2024 - 02:19
There's a couple different ways to do this. The best way I've found is, (as you've said), to just replace the block with a modded version when it's placed that uses the vanilla textures. (This was how I overrode the smithing and grindstone menus.) But if you want to use the same block, you could make a procedure that, when the enchanting table is right clicked, waits one tick, then closes the currently open GUI of the player and opens your custom GUI. This can cause a slight visual hiccup when the GUIs are switched, but should effectively solve your problem.
I don't think this is possible without something like mixins or coremods, which requires good programming knowledge
@Mindthemoods thanks for this, I am going to use the tick delay I think. Least amount of work to do, and I can retexture the vanilla GUI hiccup out either by making it invisible or making it match the new GUI for the tick or so it is visible for. Appreciate it.
...I didn't even think to make the vanilla GUI invisible. That's a great idea! And you can do it using the mod resources, without a resource pack. Huh.