@Override
protected void init()
{
super.init();
Button.IPressable onPress;
int offsetX = (this.width - this.xSize) / 2, offsetY = (this.height - this.ySize) / 2;
this.buttons.add(new Button(offsetX+153,offsetY+17,20,20,"start",(p_212984_1_) -> {
this.minecraft.displayGuiScreen(this.getMinecraft().currentScreen);})
{
@Override
public void onPress()
{
//TODO
}
});
I have made a screen,I want to add a button to do something ,I used anonymous inner classes,but whatever I write in “todo”,when I pressen the button it didn't work.Did I use the wrong method?Please help me .