Jump to content

TheKralGame

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by TheKralGame

  1. hello i want to add a button to main menu. Screen myevent = event.getGui(); if (myevent instanceof MainMenuScreen){ myevent.addButton(new Button(20, 20, 20, 20, new StringTextComponent("Text"), (e)->{ System.out.println("Sa"); })); } It says addButton is protected. I tried accesstransformers thing. and i wrote this protected net.minecraft.client.gui.screen.Screen addButton(Lnet/minecraft/client/gui/IGuiEventListener;)Lnet/minecraft/client/gui/IGuiEventListener; protected net.minecraft.client.gui.screen.Screen addListener(Lnet/minecraft/client/gui/IGuiEventListener;)Lnet/minecraft/client/gui/IGuiEventListener; but it is not working. The code of addButton and addListener protected <T extends Widget> T addButton(T button) { this.buttons.add(button); return this.addListener(button); } protected <T extends IGuiEventListener> T addListener(T listener) { this.children.add(listener); return listener; } Please help me
×
×
  • Create New...

Important Information

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