Menus and HUD

OFTRelics has three relic menus and an on-screen HUD. Players can choose which menu /relics opens for them, and turn the HUD on or off for themselves. This page explains how each one works and which settings in config.yml control it.

Choosing a menu

MenuOpen withWho can use it by default
Chest/relics chestEveryone (oftrelics.command.menu.chest)
Spatial/relics spatialEveryone (oftrelics.command.menu.spatial)
Admin/relics adminOperators (oftrelics.command.menu.admin)

/relics, /oftrelics and /oftrelics menu with no type open the player's own pick from /oftrelics style <type>, or else menu.default-type from config.yml (chest by default). /oftrelics style default clears the pick. A pick the player has since lost the permission for falls back to the server default, and tab completion only lists the menus the player may open.

Chest menu

The chest menu is an eco menu laid out by relics-gui in config.yml. Its background is a picture drawn by the resource pack (the relics_menu glyph), so players without the pack see a plain menu with the same slots.

ActionResult
Left-click an empty slot with a relic on the cursorEquips it
Left-click an equipped relic with an empty cursorPicks it up onto the cursor
Shift-click a relic in your inventoryEquips it into the first unlocked, empty, compatible slot (in config order)
Shift-click an equipped relicSends it back to your inventory

Every refusal explains itself in chat: a locked slot, a relic that doesn't fit the slot, an occupied slot, max-active reached, or a soulbound relic that belongs to someone else. The messages are in lang.yml.

relics-gui.equip-feedback plays a sound and spawns particles whenever a player equips a relic. Set enabled: false to turn it off, or set sound or particle to "" to turn off just that part.

relics-gui.custom-slots adds ordinary eco custom GUI slots to the menu, such as a close or help button, or one that runs a command.

Spatial menu

The spatial menu draws a panel of relic slots in front of the player using display entities. Only that player can see it. It uses the same slots as the chest menu (same ids, unlock conditions, displays and equipped relics), so a relic equipped in one shows in the other. Players use it like this:

  • Click an empty slot to equip the first compatible relic, looking at the held item first and then the inventory. Click an equipped slot to take the relic back.

  • Hover over a slot to highlight it and show its tooltip next to the panel.

  • Sneak, or click the close button in the panel's corner, to close it.

cursor-menu.mode chooses how it works:

Screen mode (default)

The menu is docked on the player's screen. It needs the packetevents plugin; without it, the menu falls back to world mode.

  • The player is switched to spectator mode and seated, and their view is moved to a fixed camera, so the hotbar, hands, crosshair and HUD are hidden and the panel stays in place. Moving the mouse moves a small cursor over the panel, and left click presses the button under it. The cursor lags behind by the player's ping, but the view itself never moves.

  • The previous game mode is saved on the player and restored when the menu closes, when they quit, when the plugin is disabled, and on their next join after a crash.

  • Spectators can't be hurt, so the menu won't open within screen.combat-cooldown seconds (default 5) of taking damage, nor while damage is still on its way: mid-fall, gliding, in lava or water, burning, out of air, or below the world. Spectator teleports are blocked while it is open.

  • If another plugin refuses the switch to spectator mode, the menu still works, hiding the hands with a short invisibility effect instead; the crosshair stays visible.

  • screen.offset moves the panel left or right (in degrees from the centre), screen.sensitivity sets the cursor speed, and screen.cursor-size and screen.cursor-color style the cursor.

World mode

The panel is placed in the world in front of the player, distance blocks from their eyes (following their look up or down by up to 35°), and the crosshair is the cursor. There is no lag, but the camera moves freely, so the panel can clip into nearby walls and looking away moves it out of view.

  • By default the player can keep walking and the panel moves with them, still facing the same way (follow-player). With freeze-player: true they are seated on an invisible anchor instead, and sneaking leaves the seat and closes the menu.

  • Left or right click presses a button; pressing F also closes the menu.

In both modes

  • The menu closes on damage (close-on-damage), teleport, death and world change. The relic HUD is hidden while it is open.

  • distance, vertical-offset, cell-size, padding, icon-scale, hover-scale, text-scale and tooltip-width size the panel; colors, title and hint style it; hover-sound and click-sound set its sounds (leave one empty to turn it off).

  • By default the panel uses the chest menu's rows and columns. cursor-menu.layout gives it its own grid:

    • layout.compact: true closes up rows and columns that hold no slot, such as the empty columns between the chest menu's type columns.

    • layout.slots maps slot ids to "row, column". When it isn't empty, only the listed slots are shown, at those positions. With compact, the numbers only need to be in the right order.

cursor-menu:
  layout:
    compact: true
    slots:
      ring-1: "1, 1"
      ring-2: "2, 1"
      amulet-1: "1, 2"
      amulet-2: "2, 2"

Set cursor-menu.enabled: false to turn the spatial menu off for everyone.

Admin menu

The admin menu lists every loaded relic, grouped by type. The first page shows one icon per type with its relic count; clicking one opens that type's relics, 45 per page, sorted by id. Click a relic to get one, or shift-click to get a full stack. Relics go to your inventory, or drop at your feet if it is full.

Its texts and category names are in the admin-gui section of lang.yml. Types without an entry in admin-gui.categories are shown capitalised.

The relic HUD

The HUD shows equipped relics and their levelling progress on screen. It is drawn with glyphs from the generated resource pack, so it needs the pack, and only relics with an item.texture have an icon (relics drawn with a custom model or definition show hud.no-icon-text in the static style, and no popup).

hud.style chooses what it shows:

  • popup (default): nothing is on screen until an equipped relic gains xp. Then its icon, a wide xp bar (popup.bar-width × popup.bar-height pixels) and its level slide down from the top of the screen, stay for popup.hold-seconds (refreshed by every further xp gain) and slide back up.

    • Level up: when the xp gain levels the relic up, the popup plays a short animation: the bar fills and flashes, the icon pops with a gold outline, the text reads LEVEL UP! Lv N, and popup.level-up-sound plays. Then the bar shows the new progress for a moment before the popup slides away.

    • If other relics gain xp during a level-up, the level-up finishes first and those relics are shown afterwards, one at a time. A relic at its max level only shows the popup once, for the level-up that maxed it.

    • The popup only works in boss-bar mode; in action-bar mode the static style is used.

  • static: every equipped relic's icon, a small xp bar under it, and its level, always on screen and refreshed every hud.update-ticks.

    • entry formats each relic, with %icon%, %bar%, %level% and %name%; relics without levelling use entry-no-leveling. spacing is the gap between relics in pixels.

    • %bar% draws a small xp bar under the icon before it, as wide as the icon, coloured bar.colors.max once the relic is maxed.

hud.mode chooses where it is drawn:

  • bossbar (default): the title of a boss bar at the top of the screen, coloured hud.bar-color (yellow by default). With hide-bar-texture: true the pack makes that colour's boss-bar sprites transparent, so only the HUD shows.

  • actionbar: above the hotbar. Other plugins that use the action bar will overwrite it.

With bar-on-top: true (off by default; needs packetevents), the HUD is kept above other boss bars: when it appears while others are showing, the plugin re-sends those to that player after it, which only changes the order on the client.

Players toggle the HUD for themselves with /oftrelics hud [on|off]; hud.default-enabled is the setting for players who never chose. hud.enabled: false turns it off for everyone. Size and colour options (icon-height, icon-ascent, text-ascent, bar.*, popup.bar-*, popup.colors.*, bar-color, hide-bar-texture) are baked into the resource pack, so they need /oftrelics reloadpack.


Where to go next

  • Every option for these menus: the relics-gui, cursor-menu and hud sections of the Plugin Config.

  • The pack behind the background and the HUD: the Resource Pack page.

  • Menu commands and permissions: Commands and Permissions.