Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/22/20 in all areas

  1. Yes, you need to subscribe to `GuiScreenEvent.InitGuiEvent.Pr e event)` in order to add widgets, the event itself has a method `addWidget`. Here's an example of how it could be used: @SubscribeEvent public void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(x, y, width, height, text, button -> { Minecraft.getInstance().displayGuiScreen(new CustomGUI()); })); } } If you aren't familiar with the `button -> {...}` syntax, this Button constructor takes an Button.IPressable as a parameter, which is the behavior that happens when you click. Equivalent code would look like this: @SubscribeEvent public void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(x, y, width, height, text, new CustomAction())); } } class CustomAction implements IPressable { public void onPress(Button button) { Minecraft.getInstance().displayGuiScreen(new CustomGUI()); } } Hope this helps!
    2 points
  2. You can downgrade to 1.16.1 and remove 1.16.2 mods or you can update your 1.16.1 mods to 1.16.2. Make your own topic.
    1 point
  3. You are using 1.16.1 mods on 1.16.2.
    1 point
  4. I do not believe that it is supported.
    1 point
  5. Step 1. Learn Java Step 2. Stop using MCreator and make your mod properly
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.