Sure,
This is the code after I removed Bus.MOD and changed x,y,height,width of button
@Mod.EventBusSubscriber(modid = StudyingMod.MOD_ID, bus = Bus.FORGE, value = Dist.CLIENT)
public class SurvivalInventory
{
@SubscribeEvent
public static void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event)
{
if (event.getGui() instanceof InventoryScreen)
{
event.addWidget(new Button(154, 33, 31, 14, "test", new CustomAction()));
}
}
public static class CustomAction implements IPressable {
public void onPress(Button button) {
}
}
}