{"id":106634,"date":"2026-06-06T06:46:21","date_gmt":"2026-06-06T03:46:21","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/"},"modified":"2026-06-06T06:46:21","modified_gmt":"2026-06-06T03:46:21","slug":"moxgui","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/","title":{"rendered":"Moxvallix&#8217;s GUI Library"},"content":{"rendered":"<p># Moxvallix&#8217;s GUI Lib<br \/>\n## Making Datapack GUIs easier<\/p>\n<p>**Moxvallix&#8217;s GUI Lib relies on Taglib, and Moxlib**  <\/p>\n<p>This datapack automates much of hard parts of GUI development.<br \/>\nIt is data driven, meaning it renders the GUI based on a template stored in data storage.<\/p>\n<p>Currently, the library works in two modes; &#8220;enderchest&#8221;, and &#8220;barrel&#8221;. In &#8220;enderchest&#8221; mode, the GUI is drawn<br \/>\nto the player&#8217;s Enderchest. This overrides whatever contents were previously in the enderchest, so be warned!<br \/>\nEnderchest mode is the easiest to use, and is best for Adventure maps, where the main Enderchest functionality<br \/>\nis not needed.<\/p>\n<p>The other, &#8220;barrel&#8221;, mode, draws the GUI to a container at ~ ~ ~. While this works with any container block,<br \/>\nit is advised that a Barrel is used, as that allows for it to detect when the container is opened, allowing for it<br \/>\nto then easily prevent other players using the GUI whilst the first player is.<\/p>\n<p>One benefit of this GUI system, being data driven, means that making generators for GUIs should be fairly easy.<br \/>\nI however have not created one yet.<\/p>\n<p>### Getting Started<br \/>\n#### Overview<br \/>\nDepending on whether the GUI should be drawn to a container, or the Enderchest, the API is namespaced under &#8220;barrel&#8221;,<br \/>\nor &#8220;enderchest&#8221; respectively. The following guide will use `<type>` as a placeholder for this. Swap it out for which ever<br \/>\nmethod.<\/p>\n<p>Note: type &#8220;barrel&#8221; should be executed at the same position as a container block. If you have multiple GUIs in your packs,<br \/>\nyou may want to have entities positioned at the same location as the block, executing at them.<\/p>\n<p>There are two main functions: `gui:api\/<type>\/render` and `gui:api\/<type>\/watch`.<br \/>\nRender will draw the gui, based on the page id, and watch will run any clicks in the GUI.<\/p>\n<p>All functions outside of the api\/ subfolder are to be considered private, and are not supported to be ran.<\/p>\n<p>The watch function should be run as the player, on a loop, whenever the GUI should be active.<br \/>\nIf you wanted the GUI always active, you could set it to run as @a from your tick function.<\/p>\n<p>#### Making an Index<br \/>\nFor your GUI to work, you will need an index function.<br \/>\nSuch a function, when run, will take in `@s` score of `gui.page`, and will set the correct template data for that page.<\/p>\n<p>It is recommended that you set the template data within a separate function, and that index merely calls said function.<\/p>\n<p>*An example index function*<br \/>\n&#8220;`<br \/>\nexecute if score @s gui.page matches 1 run function pack:gui\/menu<br \/>\nexecute if score @s gui.page matches 2 run function pack:gui\/options<br \/>\nexecute if score @s gui.page matches 3 run function pack:gui\/shop<br \/>\n&#8220;`<\/p>\n<p>You will then need to register your index function to run in the index tag. Add it to the `gui:index` function tag.<br \/>\n&#8220;`<br \/>\n{<br \/>\n    &#8220;values&#8221;: [<br \/>\n      &#8220;pack:gui\/index&#8221;<br \/>\n    ]<br \/>\n}<br \/>\n&#8220;`<\/p>\n<p>#### Making a Template<br \/>\nNow we can create GUI templates. These will be functions that the index will run.<\/p>\n<p>*An example template function (pack:gui\/menu)*<br \/>\n&#8220;`<br \/>\ndata modify storage gui:page template set value [{slot:12b,page:2s,item:{id:&#8221;minecraft:redstone_dust&#8221;}},{slot:14b,page:3s,item:{id:&#8221;minecraft:chest&#8221;}}]<br \/>\n&#8220;`<br \/>\nThe above menu template would render two items to the GUI, one in slot 12, the other in slot 14.<br \/>\nSlot 12:<br \/>\n  &#8211; has page:2s, would render `pack:gui\/options` when clicked<br \/>\n  &#8211; has an item tag, setting the item to `redstone_dust`<br \/>\nSlot 14:<br \/>\n  &#8211; has page:3s, would render `pack:gui\/shop` when clicked<br \/>\n  &#8211; has an item tag, setting the item to `chest`<\/p>\n<p>If you want to try it out, make sure to set your `gui.page` score to 1, then run either `gui:api\/<type>\/render`, or<br \/>\nhave `gui:api\/<type>\/watch` on loop as described above.<\/p>\n<p>#### Manipulate Slots as they Render<br \/>\nSometimes, you will want to manipulate slots as they render, such that you can have dynamic menus.<br \/>\nYou can add any custom tags you like to the slots in your template data, as long as the `slot` tag is defined.<\/p>\n<p>Every time a slot is going to be rendered, it first calls the `gui:render\/slot` function tag.<br \/>\nYou can add a custom function to this tag, in order to manipulate the slot data.<\/p>\n<p>The current slot data will be available to be manipulated from the data storage `gui:slot current`.<\/p>\n<p>Render will also call the function tag `gui:render\/item`, with @s being a temporary armor stand,<br \/>\nand the current item being rendered in its mainhand. This will allow for item modifiers to be run.<\/p>\n<p>#### Custom Functionality on Selection<br \/>\nAnother key part of a gui is being able to run custom functions when a particular slot is selected.<\/p>\n<p>Whenever a slot is selected, it calls the `gui:select\/slot` function tag,<br \/>\nas the player that selected the slot.<\/p>\n<p>You will then be able to read the selected slot from the data storage `gui:slot current`.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This datapack automates much of hard parts of GUI development.<br \/>\nIt is data driven, meaning it renders the GUI based on a template stored in data storage.<\/p>\n","protected":false},"featured_media":106635,"template":"","meta":{"_minecraft_slug":"moxgui","_minecraft_project_id":"lwRi0J1U","_minecraft_author":"moxvallix","_minecraft_license":"LGPL-3.0-or-later","_minecraft_downloads":186,"_minecraft_follows":2,"_minecraft_client_side":"optional","_minecraft_server_side":"required","_minecraft_storage_type":"zip","_minecraft_archive_name":"moxgui.zip","_minecraft_size_bytes":88203,"_minecraft_version_count":2,"_minecraft_updated_at":"2026-05-15T21:01:44.937300Z","_minecraft_date_created":"2022-12-30T21:38:29.458957Z","_minecraft_date_modified":"2023-01-10T16:18:37.696850Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/moxgui","_minecraft_icon_attachment_id":106635,"_minecraft_imported_at":"2026-06-06T03:46:22+00:00","_minecraft_import_hash":"c437f9f4854e356d0d1bca6064240d4f","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[84,873],"mod_loader":[86],"minecraft_version":[54,55,56,57],"class_list":["post-106634","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-datapack","mod_category-library","mod_loader-datapack","minecraft_version-1-19","minecraft_version-1-19-1","minecraft_version-1-19-2","minecraft_version-1-19-3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Moxvallix&#039;s GUI Library - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Moxvallix&#039;s GUI Library - Minecraft\" \/>\n<meta property=\"og:description\" content=\"This datapack automates much of hard parts of GUI development. It is data driven, meaning it renders the GUI based on a template stored in data storage.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/\",\"name\":\"Moxvallix's GUI Library - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png\",\"datePublished\":\"2026-06-06T03:46:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png\",\"width\":256,\"height\":256},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/moxgui\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Moxvallix&#8217;s GUI Library\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Moxvallix's GUI Library - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/","og_locale":"en_US","og_type":"article","og_title":"Moxvallix's GUI Library - Minecraft","og_description":"This datapack automates much of hard parts of GUI development. It is data driven, meaning it renders the GUI based on a template stored in data storage.","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/","name":"Moxvallix's GUI Library - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png","datePublished":"2026-06-06T03:46:21+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/moxgui-icon-0c57c666e7a204c5ecfcadaea6ba5fa047a5239a.png","width":256,"height":256},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/moxgui\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"Moxvallix&#8217;s GUI Library"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/106634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/106635"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=106634"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=106634"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=106634"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=106634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}