Wiki 9Minecraft Wiki 9Minecraft

PackMenu Custom Buttons

Java EditionModGuides 4FAQ 10Related mods 60
DownloadPackMenu Mod

Get the files on 9Minecraft

Contents (6)
  1. Button Schema
  2. Anchor Points
  3. Button Actions
  4. Example: Sponsor Button
  5. Next guides
  6. More in this wiki

The JSON Button is the primary interface for adding menu content. Each button specifies a position, texture, and action. Buttons can also be created without actions to serve as decorative still images.

Button Schema

Key Type Requirement Description
x int Mandatory The x position of the button in pixels, adjusted against the anchor point.
y int Mandatory The y position of the button in pixels, adjusted against the anchor point.
width int Mandatory The width of the button in pixels.
height int Mandatory The height of the button in pixels.
anchor AnchorPoint Optional The anchor point for the button. Defaults to default.
sprites WidgetSprites Optional The sprites for the button. Defaults to vanilla sprites.
icon ButtonIcon Optional An optional button icon to draw.
hover_icon ButtonIcon Optional The icon drawn when hovered. Defaults to icon.
action ButtonAction Mandatory The action performed on click.
text ButtonText Optional The text to draw on the button.
hover_text ButtonText Optional The text to draw when hovered. Defaults to text.
active boolean Optional If the button can be clicked. Defaults to true.
scale_x float Optional Scale factor for x values.
scale_y float Optional Scale factor for y values.

Anchor Points

Anchor points determine the origin (0,0) for the button's X and Y coordinates: * top_left, top_center, top_right * middle_left, center, middle_right * bottom_left, bottom_center, bottom_right

Button Actions

Action Type Description
packmenu:open_url Opens a specified URL in the user's default browser.
packmenu:connect_to_server Automatically connects the player to a specific server IP.
packmenu:quit Closes the Minecraft client.
packmenu:open_gui Opens a specific Minecraft screen (e.g., Options, Multiplayer, Language).
packmenu:open_folder Opens a local folder within the Minecraft directory.

Example: Sponsor Button

This example demonstrates a button anchored to the top right that opens a URL.

{
 "x": -150,
 "y": 0,
 "width": 150,
 "height": 20,
 "anchor": "top_right",
 "icon": {
 "texture": "packmenu:icon/akliz",
 "width": 150,
 "height": 20
 },
 "action": {
 "type": "packmenu:open_url",
 "url": "
 },
 "text": {
 "key": "packmenu.akliz",
 "x_offset": 5
 }
}