// Кнопка для Fly this.addButton(new Button(menuX + 20, menuY + 110, 160, 30, new StringTextComponent(flyEnabled ? "Disable Fly" : "Enable Fly"), button -> { if (button.isHovered() && minecraft.mouseHandler.isRightPressed()) { minecraft.setScreen(new FlySettingsScreen(this)); } else { flyEnabled = !flyEnabled; Fly.setFlyEnabled(flyEnabled); button.setMessage(new StringTextComponent(flyEnabled ? "Disable Fly" : "Enable Fly")); } }){ @Override public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { fill(matrixStack, this.x, this.y, this.x + this.width, this.y + this.height, 0xFF6600BA); drawCenteredString(matrixStack, minecraft.font, this.getMessage(), this.x + this.width / 2, this.y + (this.height - 8) / 2, 0xFFFFFFFF); } });