Differences

This shows you the differences between two versions of the page.

Link to this comparison view

api:menus [2023/06/15 14:43] – created shedanielapi:menus [2023/06/15 14:44] (current) shedaniel
Line 51: Line 51:
 </code> </code>
  
-Once you've registered your ''MenuType'', you can register a screen for your custom menu using ''ScreenManager''.+Once you've registered your ''MenuType'', you can register a screen for your custom menu.
  
 First, let's define our custom screen class, which extends ''AbstractContainerScreen'': First, let's define our custom screen class, which extends ''AbstractContainerScreen'':
Line 64: Line 64:
 </code> </code>
  
-Next, we need to register our screen with ''ScreenManager'', be sure to do this in a ''ClientLifecycleEvent.CLIENT_SETUP''.+Next, we need to register our screen, be sure to do this in a ''ClientLifecycleEvent.CLIENT_SETUP''.
 <code java> <code java>
 MenuRegistry.registerScreenFactory(EXAMPLE_MENU_TYPE.get(), ExampleScreen::new); MenuRegistry.registerScreenFactory(EXAMPLE_MENU_TYPE.get(), ExampleScreen::new);