Screen Operation API
Add controller compatibility to GUIs.
Making a screen
public class MyAmazingScreen extends Screen {
public Button button1, button2;
public MyAmazingScreen() {
super(Component.literal("My Amazing Screen"))
}
@Override
protected void init() {
this.addDrawableWidget(button1 = Button.builder(..., btn -> doButton1Action()).build())
this.addDrawableWidget(button2 = Button.builder(..., btn -> doButton2Action()).build())
}
public void doButton1Action() {
System.out.println("This is a really cool button!");
}
public void doButton2Action() {
System.out.println("This is also a really cool button!")
}
}Creating a ScreenProcessor
ScreenProcessorAttaching the ScreenProcessor
ScreenProcessorUsing the registry
Using Mixin
Using ComponentProcessor
ComponentProcessorAttaching a ComponentProcessor
ComponentProcessorUsing the registry
Using Mixin
Using button guides
More examples
Last updated