Okay, that's a great goal! Since FancyMenu elements themselves don't directly support keybinds, you'll achieve this by having an external mod's keybind trigger a FancyMenu command, which then ultimately quits Minecraft.
Here are the steps:
Step 1: Create the "Quit Minecraft" Action on a FancyMenu Element
You'll need a FancyMenu element (a button is a good choice for this) to hold the "Quit Minecraft" action. Even if you want to activate it via keybind, having it on a button makes it visually clearer and easily testable.
- Open FancyMenu Editor: Go to any screen where you want this button to exist (e.g., the Title Screen). Open the FancyMenu editor by enabling customizations for that screen and creating/opening a layout for it.
- Add a Button Element: Right-click on the editor background ->
New Element -> Button.
- Configure the Button's Action:
- Right-click the new button.
- Select
Edit Action Script.
- Click
Add Action.
- Find and select the
Quit Minecraft action (its internal ID is quitgame).
- This action doesn't require a value, so just click
Done.
- You can set the button's label to "Quit Game" or anything similar.
- Give the Button a Unique Identifier: This is CRUCIAL for the next step.
- Right-click the button again.
- Select
Copy Element Identifier. This will copy a unique ID (e.g., fancy_button_12345) to your clipboard. Save this ID.
- Save Your Layout: Press
CTRL + S or go to Layout -> Save in the menu bar.
Step 2: Use an External Mod to Bind a Key to a Command
Now you need a mod that allows you to bind a key to execute an in-game command. Examples include some macro mods or general keybinding mods. Let's assume you have such a mod installed.