1.6.X | Custom Buttons

About

You can create custom buttons for menus and specify what they do.
There are some very useful button actions you can attach to it to let it open links, join servers, sending commands and much more!

NOTE: This documentation page is focused on manually creating custom buttons. If you don't want to do this, you can use the layout editor to edit menus ingame with a GUI, like you know it from all the fancy editing softwares out there.

Creating Custom Buttons

To create a custom button, you have to create a customization file first!

In your customization file, create a new customization section for the addbutton customization action.

A functional customization section to add a custom button to a menu can look like this:

customization {
  action = createbutton
  label = My Button
  buttonaction = openlink
  value = https://google.com
  backgroundnormal = textures/mytexture.png
  backgroundhovered = textures/mytexture2.png
  hideforseconds = 2.6
}

The most important part in the example above is the buttonaction variable.
This variable specifies which action the button should do when it's getting clicked.

The value variable specifies the content of the buttonaction. This may be nothing for specific button actions like quitgame and is mandatory for button actions like sendmessage to define the message to send.

Button Actions

Value needed? Value content Examples
Yes The link value = https://google.de

sendmessage

Send a message or a command to the chat.

Value needed? Value content Examples
Yes The message/command value = Hi everyone! :)
----
value = /time set 0

quitgame

Quit minecraft.

Value needed? Value content Examples
No / /

joinserver

Join a minecraft server.

Value needed? Value content Examples
Yes The server IP value = 127.0.0.1:25565
----
value = play.hivemc.com

loadworld

Load a minecraft world (from the client's playable minecraft worlds).

Value needed? Value content Examples
Yes The world folder name value = My World
----
value = cool_world

openfile

Open a file or folder.

Value needed? Value content Examples
Yes The path to the file/folder value = mydata/info.txt
----
value = images/minecraft

movefile

Move a file to a new path.

Value needed? Value content Examples
Yes The old file path and the new file path, separated by semicolon (';'). value = path/to/file.txt;new/path/of/file.txt

copyfile

Copy a file.

Value needed? Value content Examples
Yes The path to the file and the path to copy it to, separated by semicolon (';'). value = path/to/file.txt;copy/to/path/filecopy.txt

deletefile

Completely delete a file.

Value needed? Value content Examples
Yes The path to the file. value = path/to/file.txt

renamefile

Rename a file.

Value needed? Value content Examples
Yes The path to the file and its new name, separated by semicolon (';'). value = path/to/file.txt;newfilename.txt

downloadfile

Download a file from the web.
This action runs in the main thread, which means it will cause the game to freeze until it is done.

Value needed? Value content Examples
Yes The URL to the file and the path to save it to, separated by semicolon (';'). value = https://myhoster.com/archive.zip;path/to/save/archive.zip

unpackzip

Unpack a ZIP file.
This action runs in the main thread, which means it will cause the game to freeze until it is done.

Value needed? Value content Examples
Yes The path to the ZIP file and the directory to unpack it to, separated by semicolon (';'). value = path/to/archive.zip;unpack/to/path/

prevbackground

Switch to the previous menu background animation.

Value needed? Value content Examples
No / /

nextbackground

Switch to the next menu background animation.

Value needed? Value content Examples
No / /

opencustomgui

Open one of your custom GUIs.

Value needed? Value content Examples
Yes The custom GUI identifier value = mycoolmenu

opengui

Open an existing GUI by its menu identifier.

Value needed? Value content Examples
Yes The menu identifier (Get it by clicking on the "Menu Info" button in menus) value = the.menu.identifier

reloadmenu

Reload the current menu along with reloading customization files, the mod config, button scripts and more.
This action is similar to clicking the "Reload" button in the top-right corner of supported menus.

Value needed? Value content Examples
No / /

runscript

Run a button script.

Value needed? Value content Examples
Yes The file name of your script, without the file extension. value = myscript

mutebackgroundsounds

Mute or unmute background audio added by FancyMenu.

Value needed? Value content Examples
Yes true/false (to mute or unmute the audio) value = true