Resource Pack

OFTRelics builds a Minecraft resource pack at runtime from your relic configs, instead of shipping a static pack you have to maintain by hand, and serves it to players from a small web server inside the plugin. This page covers where assets live, how relic models are generated, the GUI and HUD glyphs, hosting, and delivery.

How it fits together

On every /oftrelics reload (and on start-up), OFTRelics:

  1. Copies the bundled default assets (relic textures, slot icons, the menu background) into OFTRelics/pack/, without overwriting files that are already there.

  2. Reads every relic's item.texture, item.model or item.definition.

  3. Merges everything under OFTRelics/pack/ with the files it generates: item definitions and models, the menu background font, the HUD font and bars, and (if enabled) a transparent boss-bar texture.

  4. Zips the result to OFTRelics/pack.zip and hashes it (SHA-1). Identical input gives an identical file and hash, and a reload that changed nothing reuses the previous build.

  5. Serves it from the built-in web server and sends it to online players (send-on-reload).

The build runs off the main thread, so a large pack doesn't freeze the server. /oftrelics reloadpack rebuilds and re-sends only the pack, without reloading relics.

Static assets live under OFTRelics/pack/assets/<namespace>/..., in the standard resource-pack layout. resource-pack.namespace in config.yml sets <namespace> (oftrelics by default). When you change it, the bundled textures are copied into the new namespace; files you added under the old one have to be moved by hand.

Relic item models

A relic's item: section chooses its model. Pick one of these:

From a texture

item:
  texture: item/magmatic_ring # Relative to assets/<namespace>/textures/, without .png
  texture-parent: generated # generated (default), handheld, or a full model id

Put the PNG at:

OFTRelics/pack/assets/oftrelics/textures/item/magmatic_ring.png

OFTRelics generates the model for you (minecraft:item/generated with your texture as layer0). If a model JSON already exists at the same path under models/, that one is used instead. Two relics may share a texture with different parents; each then gets its own model.

A path with a namespace, such as minecraft:item/gold_nugget, points at another namespace, including vanilla textures.

The relic's texture is also its icon in the HUD, so only relics with an item.texture show an icon there.

From an existing model

item:
  model: item/magmatic_ring # A model JSON at pack/assets/<namespace>/models/item/magmatic_ring.json

From a raw item definition

item:
  # Full control: a Minecraft item definition, written to
  # assets/<namespace>/items/<relic id>.json exactly as given.
  definition:
    model:
      type: minecraft:model
      model: oftrelics:item/magmatic_ring

Use this for anything the other two can't do, such as models that change with item state.

GUI backgrounds and icons

Two mechanisms in config.yml cover GUI art:

gui-glyphs: menu backgrounds

Large pictures drawn behind a menu, using a character of a custom font in the menu title and the same space-shifting trick as EcoItems. The chest menu uses the relics_menu glyph (relics-gui.background-glyph).

resource-pack:
  gui-glyphs:
    relics_menu:
      texture: gui/relics_menu # pack/assets/<namespace>/textures/gui/relics_menu.png
      ascent: 37 # Vertical position; +1 moves the picture up 1 pixel
      height: 256
      width: 256 # (Optional) Detected from the PNG if omitted
      codepoint: "U+E000" # (Optional) Assigned from U+E000 upwards if omitted
      offset-x: 1 # (Optional) Horizontal nudge in pixels; positive moves right

The picture is centred over a vanilla chest menu. Tune ascent and offset-x by eye: change one, run /oftrelics reloadpack, compare a screenshot against a known reference (like a real inventory slot), and adjust by the pixel difference; both map one-to-one to pixels.

gui-icons: slot icons

Small item-model icons, referenced by id from a model: key on a display config. The default slots use them for empty and locked slots:

resource-pack:
  gui-icons:
    empty-slot:
      texture: item/plus_gray
      texture-parent: generated
    locked-slot:
      texture: item/lock_gray
      texture-parent: generated
empty-display:
  item: structure_void # Fallback item for players without the pack
  model: empty-slot # Replaced by the icon above for players with the pack

The HUD in the pack

The relic HUD is drawn entirely with glyphs from the pack: each relic's texture becomes a glyph of the <namespace>:hud font, the xp bars are generated as images in every state, the popup's animation frames are separate fonts, and HUD text uses a lowered copy of the vanilla ASCII font so it sits level with the icons (other characters fall back to the normal font).

With hud.hide-bar-texture: true in boss-bar mode, the pack also replaces the boss-bar sprites of hud.bar-color with transparent ones. HUD size and colour settings are baked into the pack, so changes to them need /oftrelics reloadpack.

Self-hosting

resource-pack:
  enabled: true
  self-host:
    enabled: true
    bind: "0.0.0.0" # Network address the web server listens on
    port: 8173
    public-url: "" # The address players download from, e.g. "http://203.0.113.4:8173"
    auto-detect-public-ip: false

Hosting the pack from the Minecraft server itself is the only supported way to deliver it; there's no external host or CDN option. The pack is served at <public-url>/packs/<sha1>.zip. Before the pack is sent to anyone, the plugin downloads it from its own web server once to check that it works.

auto-detect-public-ip: true fills in a blank public-url by asking outside "what's my IP" services (api.ipify.org, checkip.amazonaws.com, ipv4.icanhazip.com) on reload and using that IP with port. It's off by default because it doesn't work behind NAT, panels or port forwarding, where the detected IP or port isn't what players connect through.

The default port is 8173, not 8163, because 8163 is EcoItems' self-hosted pack port and two servers can't share a port.

With self-host.enabled: false, the pack is still built to pack.zip, so you can merge it into another pack or host it elsewhere yourself, but OFTRelics doesn't send it.

Delivery

resource-pack:
  delivery:
    prompt: "&fThis server uses a resource pack for custom relics"
    required: false
    kick-on-decline: false
    send-on-join: true
    join-delay-ticks: 10
    send-on-reload: true
OptionWhat it does
promptThe message on the client's download screen
requiredMarks the pack as required on the client's prompt
kick-on-declineWith required: true, kicks players who decline it (message pack-declined in lang.yml)
send-on-joinSends the pack join-delay-ticks after a player joins
send-on-reloadRe-sends the pack to everyone online whenever it is rebuilt

OFTRelics adds its pack next to other plugins' packs (for example EcoItems'), instead of replacing them, and re-sending only replaces its own previous pack. Declining another plugin's pack never gets a player kicked by OFTRelics.

/oftrelics sendpack [player] sends the current pack to one player by hand.

Supported versions

resource-pack:
  pack-format: 46 # The oldest supported client: Minecraft 1.21.4
  max-pack-format: 88 # The newest: Minecraft 26.2

The pack uses item model definitions, which need Minecraft 1.21.4 or newer. Clients outside the declared range are told the pack is incompatible. minify-json writes the JSON files without spacing, to keep the pack small.


Where to go next

  • Give a relic a custom look: the Item section of the How to Make a Relic guide.

  • Every resource-pack option: the Plugin Config reference.

  • Rebuild or re-send by hand: /oftrelics reloadpack and sendpack in Commands and Permissions.