Skip to Content
1robie

Machine menus

zMenu machine menus: which file a machine opens, button types, and textured menus.

With zMenu installed, right-clicking a machine (with machineengine.use) opens its menu. Menus are ordinary zMenu inventory files in plugins/MachineEngine/menus/, with MachineEngine's placeholders and button types. Everything zMenu offers works as usual — see the zMenu documentation.

/machineengine reload config reloads the menu files.

Which file a machine opens

  1. The file named for its type under menus.by-type in config.yml.
  2. Else <namespace>_<value>.yml: mekanized_basic_bin.yml for mekanized:basic_bin.
  3. Else menus.default (machine.yml).

machine.yml is written on the first start (and when missing), with every placeholder and button type listed in its comments. Addons install their own files (Mekanized writes mekanized_*.yml).

Live values

Buttons with update: true are redrawn every update-interval milliseconds. A button whose material holds a machine placeholder needs no update: true: MachineEngine redraws all of them together, every update-interval and whenever the machine changes, so the cells of a bar never disagree.

Button types

machineengine_slot

One slot of a machine storage. Items are shown as the real item; empty slots and other resources use the button's item. Clicking puts the cursor item in (right-click: one), or takes the contents out; shift-clicking an item in the player's inventory puts it into the menu's slots in order.

input-slot:
  type: machineengine_slot
  slot: 20
  storage: input # storage id (default input)
  storage-slot: 1 # 1-based slot of that storage (default 1)
  allow-insert: true # default true
  allow-take: true # default true
  item: {material: LIGHT_GRAY_STAINED_GLASS_PANE, name: '&7Input'}

machineengine_cancel_process

Cancels the running process; its inputs go back to the machine. Hidden while nothing runs, unless always-show: true.

machineengine_upgrades

The upgrade tab. Clicking with upgrades on the cursor installs as many as fit (right-click: one). An empty hand opens the upgrades menu: menu: <file>, else <the machine's menu>_upgrades; when there is none, the last installed upgrade comes back as an item.

upgrades:
  type: machineengine_upgrades
  slot: 8
  item:
    {
      material: NETHER_STAR,
      name: '&bUpgrades',
      lore: ['&7%zmenu_machineengine_upgrades%'],
    }

machineengine_action

Runs one of the machine type's actions with the click (left, right, shift, drop) and the stack on the cursor. What the action takes comes off the cursor; what it gives goes to the player's inventory; its message shows on the action bar. Hidden on machines that do not have the action.

Every machine with upgrade slots has the action upgrade and the list upgrades. Addons add their own (Mekanized's modification station: module and modules).

KeyMeaning
actionThe action to run.
indexPassed to the action (the row of a list), default 0.
listHides the button when index is past the end of that list: one button per row.
emptyWith list: what a row past the end shows instead of hiding (material, name, lore); clicking does nothing.
inputtrue: a shift-click on a stack in the player's inventory runs the action too. One button per menu.
upgrade-0:
  type: machineengine_action
  action: upgrade # held upgrades: install; empty hand: take one out (shift: all)
  list: upgrades
  index: 0
  slot: 19
  item:
    material: 'craftengine:%zmenu_machineengine_list_upgrades_0_item%'
    name: '%zmenu_machineengine_list_upgrades_0_count%/%zmenu_machineengine_list_upgrades_0_max%'
  empty: {material: LIGHT_GRAY_STAINED_GLASS_PANE, name: '<gray>No upgrade'}
input:
  type: machineengine_action
  action: upgrade
  input: true # shift-clicking upgrades in the player's inventory installs them
  index: 99
  slot: 40
  item: {material: HOPPER, name: 'Put upgrades here'}

machineengine_data

Changes a setting of the machine that its type declares (data: <id>), such as a mode: a switch is toggled, a text goes to the next of values: [...]. Show it with %zmenu_machineengine_data_<id>%.

machineengine_side

Side configuration: what one side (side: front, back, left, right, top, bottom) does for a port group (group: items) — input, output, both or nothing. A click goes to the next state the machine allows. Hidden when the machine has no port in the group. Show it with %zmenu_machineengine_side_<group>_<side>%.

machineengine_menu

Opens another menu for the same machine (menu: <file>); without menu, the machine's own menu (a back button). zMenu's own inventory button would lose which machine the menu shows.

  • group: items: shown only for machines with ports in that group.
  • groups: [items, energy]: opens <menu>_<group> for the first group the machine has.

machineengine_player_setting

Changes one of the viewer's own settings (setting: <namespace>:<id>): left click toggles or goes forward, right click goes back. Hidden when the setting is not installed or the server locked it. Works in any zMenu menu — see Player data and settings.

Textured menus

Menus can look like a mod's GUI, drawn by CraftEngine's resource pack:

  • The title holds what does not move — the panel, slot frames, bar frames — as CraftEngine images (<image:…> and <shift:…> tags) that CraftEngine turns into resource pack glyphs.
  • Slots hold CraftEngine items for what changes. A fill bar covers 3 slots, cell 0 at the bottom (or left): each slot's material picks the item for its level with _cell_<k> (0 to 18, 16 for the last cell), and components: dyed-color tints it with _color:
item:
  material: 'craftengine:mekanized:gui/bar/chemical/0/%zmenu_machineengine_storage_tank_cell_0%'
  components:
    dyed-color: '%zmenu_machineengine_storage_tank_color%'
  flags: [HIDE_DYE, HIDE_ATTRIBUTES]

The images and bar items come from a CraftEngine pack — Mekanized ships a full set (mekanized:gui/…). Players need the resource pack: without it, titles show boxes and bars are invisible.

The Mekanized crusher menu, textured like Mekanism, mid-process

Mekanized's crusher menu: a zMenu inventory drawn by the resource pack, with live progress and energy bars.

The Modification Station menu with installed modules and empty module rows

The Modification Station: one action button per module row, empty rows shown faded.

Last updated on

On this page