Jump to content

custom GUI mod

Vadim Kurbatov

Recommended Posts

The mod must be tied to the logic of the Forge API, Minecraft 1.19.
The main task - is to make your own gui for the inventory or just a separate gui, which will implement the basic functions for the marketplace (as in the various plugins). This needs to be implemented specifically by a mod. So far I've tried creating a class that inherits the Screen and setting as new ( minecraft.setScreen(new CustomScreen())), but the main inventory stops working (not moving things from slot to slot). Also tried overriding the InventoryScreen class, but the problem is the same as above. Decided to start simple, namely adding a button to the main inventory. Logic: listening for the ScreenEvent event, and setting the new button as a widget. 

    public static void openInventoryGui(ScreenEvent e) {
        Minecraft minecraft = Minecraft.getInstance();
        if (minecraft.screen != null) {
            Screen current = e.getScreen();
            if (current.passEvents) {
                Button button = new Button(10, 10, 10, 10, Component.literal("TEST"), (a) -> {

But so far the button does not work (should output text to the console). 
Regarding ScreenEvent.InitScreenEvent - I could not do anything with it (it is not in the class, found no such event).

What can I read or what guides to look at this topic? Or maybe someone has advice or experience in this matter?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...