{"id":26359241,"url":"https://github.com/hashtek-mc/hashgui","last_synced_at":"2026-04-15T20:02:35.329Z","repository":{"id":222503049,"uuid":"753082545","full_name":"hashtek-mc/hashgui","owner":"hashtek-mc","description":"Générateur de GUI et d'item personnalisés. Manager d'interactions avec les items (clics ou interactions).","archived":false,"fork":false,"pushed_at":"2024-11-12T22:39:32.000Z","size":246,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-30T04:45:19.437Z","etag":null,"topics":["builder","gui","gui-builder","hashtek","item","item-builder","java","java-16","library","mask","minecraft","page","paginated-gui","spigot"],"latest_commit_sha":null,"homepage":"https://hashtek.fr","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashtek-mc.png","metadata":{"files":{"readme":"README-en.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-05T12:42:36.000Z","updated_at":"2024-11-12T22:39:36.000Z","dependencies_parsed_at":"2024-03-28T22:28:20.669Z","dependency_job_id":"59cec113-ebb8-470a-912a-840aa802eaf2","html_url":"https://github.com/hashtek-mc/hashgui","commit_stats":null,"previous_names":["hashtek-mc/hashgui"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/hashtek-mc/hashgui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashtek-mc%2Fhashgui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashtek-mc%2Fhashgui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashtek-mc%2Fhashgui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashtek-mc%2Fhashgui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashtek-mc","download_url":"https://codeload.github.com/hashtek-mc/hashgui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashtek-mc%2Fhashgui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31857625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","gui","gui-builder","hashtek","item","item-builder","java","java-16","library","mask","minecraft","page","paginated-gui","spigot"],"created_at":"2025-03-16T15:59:04.496Z","updated_at":"2026-04-15T20:02:35.312Z","avatar_url":"https://github.com/hashtek-mc.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎨 ️HashGui\r\n\r\nLibrary that lets you create customized GUIs and items quickly and easily.\r\n\r\nThis library has two main classes:\r\n* **HashItem:** Item builder\r\n* **HashGui:** GUI builder\r\n\r\n[🇫🇷 Egalement disponible en Français !](https://github.com/hashtek-mc/hashgui/blob/main/README.md)\r\n\r\n## Installation\r\n\r\nAfter installation, the .jar file is located in the `builds/libs/` folder.\r\n\r\n### Linux / MacOS :\r\n\r\n```shell\r\n./gradlew make\r\n```\r\n\r\n### Windows\r\n\r\n```shell\r\n.\\gradlew.bat make\r\n```\r\n\r\n## HashItem\r\n\r\n### Usage\r\n\r\n**Custom item creation:**\r\n\r\n```java\r\nHashItem item = new HashItem(Material.ENDER_PEARL, 10)\r\n  .setName(\"Hi\")\r\n  .setLore(Arrays.asList(\r\n    \"Line 1\",\r\n    \"Line 2\"\r\n  ))\r\n  .addLore(\"Line 3\")\r\n  .setFlags(Arrays.asList(\r\n    ItemFlag.HIDE_ATTRIBUTES,\r\n    ItemFlag.HIDE_ENCHANTS\r\n  ))\r\n  .addFlag(ItemFlag.HIDE_UNBREAKABLE)\r\n  .addEnchant(Enchantment.DURABILITY, 3)\r\n  .setUnbreakable(true)\r\n  .build();\r\n\r\nInventory#addItem(item.getItemStack());\r\n```\r\n\r\n\u003e [!WARNING]\r\n\u003e Don't forget to `build()` the item before using it!\\\r\n\u003e Always import from `org.bukkit` package.\r\n\r\n\u003e [!TIP]\r\n`ℹ️` Also see [Material](https://helpch.at/docs/1.8/org/bukkit/Material.html), [ItemFlag](https://helpch.at/docs/1.8/index.html?org/bukkit/inventory/ItemFlag.html) and [Enchantment](https://helpch.at/docs/1.8/index.html?org/bukkit/enchantments/Enchantment.html) enums.\r\n(from `org.bukkit`).\r\n\r\n### Features\r\n\r\n* `setType()`: Item\r\n* `setAmount()`: Item amount\r\n* `setDurability()`: Item's durability\r\n* `setData()`: Item's data\r\n* `setName()`: Item's name\r\n* `setLore()`: Replaces item's description\r\n* `addLore()`: Appends a string to item's description\r\n* `setFlags()`: Replaces item's flags\r\n* `addFlag()`: Adds a flag to the item\r\n* `setUnbreakable()`: Makes the item unbreakable\r\n* `addEnchant()`: Adds an enchantment to the item\r\n* `removeEnchant()`: Removes an enchantment from the item\r\n* `build()`: Builds the item so it can be used\r\n\r\n### Handlers\r\n\r\nAn Handler is a code snippet which will be executed when a player will perform a certain action\\\r\nwith an item.\r\n\r\n### Usage (example : Click handler)\r\n\r\n```java\r\nClickHandler clickHandler = new ClickHandler()\r\n    .addClickType(ClickType.LEFT)\r\n    .setClickAction((Player player, HashGui gui, ItemStack clickedItem, int clickedSlot) -\u003e {\r\n        // Actions to perform on click.\r\n    });\r\n\r\nHashItem item = new HashItem(Material.COMPASS)\r\n    .addClickHandler(clickHandler);\r\n    .build(guiManager);\r\n```\r\n\r\n\u003e [!WARNING]\r\n\u003e `guiManager` (in the `build()` function) must be an instance of [HashGuiManager](#hashguimanager),\r\nwhich must be stored at the root of your plugin.\r\nThis instance takes care of detecting clicks and executing the appropriate action depending on the item.\r\n\r\n\u003e [!WARNING]\r\n\u003e Item targeting is based on its `displayName`, so be careful not to give the same name to two items\r\nif you don't want them to execute the same thing.\r\nIf two items must have the same name but a different click handler, then mess with the color codes so that it's not\r\nvisible from the player's point of view 😉 (`\"§cHi\"` and `\"§r§cHi\"` are different but look the same on player's POV)\r\n\r\n### Click handler\r\n\r\nYou can define the action executed when a player clicks on an item in a GUI.\r\n\r\n#### Features :\r\n\r\n- Click type (left click, right click, shift + click...)\r\n```java\r\nClickHandler#addClickType(ClickType.LEFT);\r\nClickHandler#addClickTypes(ClickType.SHIFT_LEFT, ClickType.SHIFT_RIGHT); // Adds multiple click types at once.\r\nClickHandler#addAllClickTypes(); // Adds every click type.\r\n```\r\n\r\n\u003e [!TIP]\r\n\u003e See [ClickType](https://helpch.at/docs/1.8/org/bukkit/event/inventory/ClickType.html) enum (from `org.bukkit`).\r\n\r\n### 🫱 Interaction handler\r\n\r\nYou can define the action executed when a player interacts with an item.\r\n\r\n#### Features :\r\n\r\n- Interaction type (left click, right click, in the air, or not...)\r\n```java\r\nInteractHandler#addInteractType(Action.LEFT_CLICK_AIR);\r\nInteractHandler#addInteractTypes(Action.RIGHT_CLICK_AIR, Action.RIGHT_CLICK_BLOCK); // Adds multiple interaction types at once.\r\nInteractHandler#addAllInteractTypes(); // Adds every interaction types.\r\n```\r\n\r\n\u003e [!TIP]\r\n\u003e See [Action](https://helpch.at/docs/1.8/index.html?org/bukkit/event/block/Action.html) enum (from `org.bukkit`).\r\n\r\n### 🫱 Hold handler\r\n\r\nYou can define the action executed when a player holds (or takes off) an item in his hand.\r\n\r\n#### Features :\r\n\r\n- Hold action (action executed when the player takes the item in his hand)\r\n```java\r\nHoldAction action = (Player player, ItemStack item, int slot) -\u003e {\r\n    // ...\r\n};\r\n\r\nHoldHandler#setHoldAction(action);\r\n```\r\n\r\n- Not hold action (action executed when the player takes the item off his hand)\r\n```java\r\nHoldAction action = (Player player, ItemStack item, int slot) -\u003e {\r\n    // ...\r\n};\r\n\r\nHoldHandler#setNotHoldAction(action);\r\n```\r\n\r\n\u003e [!CAUTION]\r\n\u003e Armors are compatible with `HoldHandler`.\\\r\n\u003e However, if you use the `PlayerInventory#setHelmet` function (or another method to define an armor piece),\r\n\u003e `HoldHandler` will NOT detect it automatically.\\\r\n\u003e You must call the `HashGuiHold#refreshArmorState(Player player)` function to refresh the detection.\r\n\r\n### 🫱 Hit handler\r\n\r\nYou can define the action executed when a player hits another player with an item.\r\n\r\n#### Features :\r\n\r\n- Death only (executes the action only if the hit results in a death)\r\n```java\r\nHitHandler#setOnlyKill(true);\r\n```\r\n\r\n### 🫱 Destroy handler\r\n\r\nYou can define the action executed when a player breaks a block with an item.\r\n\r\n\r\n### HashGuiManager\r\n\r\nIn order to make handlers working, you need to create an instance of `HashGuiManager` at the root\r\nof your plugin and give this instance to your custom item build.\r\n\r\n**Example:**\r\n```java\r\npublic class Test extends JavaPlugin {\r\n    \r\n    private PluginManager pluginManager;\r\n    private HashGuiManager guiManager;\r\n    \r\n    \r\n    /* Variable initialization at server startup */\r\n    @Override\r\n    public void onEnable()\r\n    {\r\n        this.pluginManager = this.getServer().getPluginManager();\r\n        this.setupGuiManager();\r\n        \r\n        // Your code here\r\n    }\r\n    \r\n    /* Manager initialization and configuration */\r\n    private void setupGuiManager()\r\n    {\r\n        this.guiManager = new HashGuiManager(this, this.pluginManager);\r\n        this.guiManager.setup();\r\n    }\r\n    \r\n    \r\n    /* GUI Manager's getter */\r\n    public HashGuiManager getGuiManager()\r\n    {\r\n        return this.guiManager;\r\n    }\r\n    \r\n}\r\n```\r\n\r\n\u003e [!TIP]\r\n\u003e It is strongly recommended to only have one instance of HashGuiManager instance in your plugin\r\n(in fact, I forbid you to have more than one).\r\n\r\n### HashSkull\r\n\r\n**Creation of a player's skull:**\r\n```java\r\nHashItem playerSkull = new HashSkull()\r\n    .setOwner(\"Shuvly\") // HashSkull\r\n    .setName(\"Shuvly's head\") // HashItem\r\n    .build();\r\n```\r\n\r\n\u003e [!TIP]\r\n\u003e Make all changes to `HashSkull` first before making changes to `HashItem`.\r\n\r\n**Creation of a custom skull:**\r\n```java\r\nHashItem customSkull = new HashSkull()\r\n    .setTexture(\"...\") // Your texture here\r\n    .setName(\"Custom head\")\r\n    .build();\r\n```\r\n\r\nTexture example (in `base64`): `eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWY0OGMxOTU1NTUwZWFlZGU1NzEzYTdiY2NjOWE0YWUyZTZlMTcxZTI5YWMxYzcxYzBlM2QxYWJiNzI5MGNjYSJ9fX0=`\r\n\r\n\u003e [!TIP]\r\n\u003e Make all changes to `HashSkull` first before making changes to `HashItem`.\r\n\r\n\u003e [!TIP]\r\n\u003e You can find custom skulls on [Minecraft Heads](https://minecraft-heads.com/).\\\r\nWhen you're on the head page, scroll down to the \"For developers\" section to find the texture value in `base64`.\r\n\r\n## HashGui\r\n\r\n### Usage\r\n\r\n**GUI creation:**\r\n```java\r\nHashItem item = new HashItem(Material.SIGN)\r\n  .setName(\"Settings\")\r\n  .addLore(\"Right click to access parameters\")\r\n  .build();\r\n\r\nHashGui gui = new HashGui(\"Menu\", 5)\r\n    .setItem(3, item);\r\n    \r\ngui.open(player);\r\n```\r\n\r\n### Features\r\n\r\n* `open()`: Opens the GUI to a player\r\n* `close()`: Closes the GUI to a player\r\n* `update()`: Refreshes a player's GUI\r\n* `setItem()`: Sets an item in the GUI\r\n\r\n### Masks\r\n\r\nMasks (`Mask`) are used to create a GUI layout.\r\n\r\nFor example, if you want to make a border like this :\r\n\r\n![](https://cdn.discordapp.com/attachments/1201670734095859812/1204883310489378907/image.png?ex=65d65a06\u0026is=65c3e506\u0026hm=85681f65261a9a6a3cd8a45c6018a3b2efbaa1d6c5cd1e6ec83f836e6edbf44a\u0026)\r\n\r\n... a normal code would be :\r\n\r\n```java\r\nItemStack glass = new ItemStack(Material.STAINED_GLASS_PANE);\r\nItemStack grass = new ItemStack(Material.GRASS);\r\nItemStack glowstone = new ItemStack(Material.GLOWSTONE);\r\nItemStack bookshelf = new ItemStack(Material.BOOKSHELF);\r\n\r\nfor (int i = 0 ; i \u003c 10 ; i++) {\r\n    menu.setItem(i, glass);\r\n}\r\nfor (int i = 17 ; i \u003c 26 ; i++) {\r\n    menu.setItem(i, glass);\r\n}\r\nmenu.setItem(11, grass);\r\nmenu.setItem(13, glowstone);\r\nmenu.setItem(15, bookshelf);\r\n```\r\n\r\nBut it's not really effective...\\\r\nHere comes the masks. The code above then becomes:\r\n\r\n```java\r\nItemStack glass = new ItemStack(Material.STAINED_GLASS_PANE);\r\nItemStack grass = new ItemStack(Material.GRASS);\r\nItemStack glowstone = new ItemStack(Material.GLOWSTONE);\r\nItemStack bookshelf = new ItemStack(Material.BOOKSHELF);\r\n\r\n/*                   ⬇️ Must be a HashGUI instance. */\r\nMask mask = new Mask(menu);\r\n\r\nmask.setItem('s', glass);\r\n    .setItem('g', grass);\r\n    .setItem('l', glowstone);\r\n    .setItem('b', bookshelf);\r\n    \r\n/*            ⬇️ Must be 9 characters long. */\r\nmask.pattern(\"sssssssss\")\r\n    .pattern(\"s g l b s\")\r\n    .pattern(\"sssssssss\");\r\n    \r\nmask.apply();\r\n```\r\n\r\nWay better isn't it?\r\n\r\nIf a letter has no assigned item, this one will be used:\r\n\r\n![](https://cdn.discordapp.com/attachments/1201670734095859812/1204886714057752636/image.png?ex=65d65d32\u0026is=65c3e832\u0026hm=f396f4b9e3373d56fe0bd5c34b2f4d21429b7bbe04653fcfc44040f88412114a\u0026)\r\n\r\n\u003e [!CAUTION]\r\n\u003e Space character (` `) can't be used, as it serves as void.\r\n\r\n## PaginatedHashGui\r\n\r\n`PaginatedHashGui` is a `HashGui` with a pagination system.\r\n\r\n### Usage\r\n\r\n```java\r\nString title = \"Paginated menu\";\r\nint linesAmount = 6;\r\n\r\nPaginatedHashGui gui = new PaginatedHashGui(title, linesAmount, guiManager); // guiManager must be an instance of HashGuiManager.\r\n\r\nHashItem previousPage = new HashItem(Material.ARROW)\r\n    .setName(\"Previous page\");\r\n\r\nHashItem nextPage = new HashItem(Material.ARROW)\r\n    .setName(\"Next page\");\r\n\r\ngui.setPreviousPageItem(previousPage); // When clicking on previousPage, the GUI will refresh to the previous page.\r\ngui.setNextPageItem(nextPage); // When clicking on previousPage, the GUI will refresh to the next page.\r\n```\r\n\r\n#### Features\r\n\r\n* `setPreviousPageItem(HashItem item)` : Refreshes the GUI to the previous page (if possible)\r\n* `setNextPageItem(HashItem item)` : Refreshes the GUI to the next page (if possible)\r\n* `update(Player player)` : Refreshes the GUI (for the pages)\r\n* `clearPageContent()` : Visually clears current page (used for refreshing)\r\n* `addPage(Page page)` : Adds a new page\r\n* `createNewPage()` : Creates a fresh new page and adds it\r\n* `clearPages()` : Deletes all pages\r\n\r\n### Pages\r\n\r\n#### Page creation\r\n\r\n```java\r\nPaginatedHashGui gui;\r\n\r\nPage page = gui.createNewPage(); // Creates a new page and adds it to the GUI\r\n\r\n/* OR */\r\n\r\nPage page = new Page(gui); // Creates a new page\r\ngui.addPage(page); // Adds it to the GUI\r\n```\r\n\r\n#### Features\r\n* `addItem(HashItem item)` : Adds an item in the page at the first free slot\r\n* `setItem(int slot, HashItem item)` : Adds an item in the page at a specific slot\r\n* `removeItem(int slot)` : Removes the item linked to a slot\r\n* `clearItems()` : Clears page's items\r\n\r\n\u003e [!TIP]\r\n\u003e By default, at the creation of a `PaginatedHashGui`, a fresh new page will be automatically created and added.\r\n\r\n#### Page management\r\n\r\n```java\r\nPage page;\r\n\r\nHashItem item1 = new HashItem(Material.BED);\r\nHashItem item2 = new HashItem(Material.BEDROCK);\r\n\r\npage.addItem(item1);\r\npage.setItem(8, item2);\r\npage.removeItem(8);\r\n```\r\n\r\n\u003e [!WARNING]\r\n\u003e * For `Page#addItem()`, if no slots are free, a `IllegalArgumentException` will be thrown.\r\n\u003e * For `Page#setItem()` or `Page#removeItem()`, if the given slot is not free, the same exception will be thrown.\r\n\u003e * **A slot is considered not free if it's not valid (below 0 or greater than the maximum capacity of the GUI)\r\n    \u003e or if an item is already present at this slot in the parent GUI.**\r\n\r\n## Made with 💜 by [Lysandre B.](https://github.com/Shuvlyy) ・ [![wakatime](https://wakatime.com/badge/user/2f50fe6c-0368-4bef-aa01-3a67193b63f8/project/018d794b-8bf6-46ef-acb3-549287335474.svg)](https://wakatime.com/badge/user/2f50fe6c-0368-4bef-aa01-3a67193b63f8/project/018d794b-8bf6-46ef-acb3-549287335474) + [![wakatime](https://wakatime.com/badge/user/2f50fe6c-0368-4bef-aa01-3a67193b63f8/project/018d7a18-67ef-47e3-a6c4-5c8cc4b45021.svg)](https://wakatime.com/badge/user/2f50fe6c-0368-4bef-aa01-3a67193b63f8/project/018d7a18-67ef-47e3-a6c4-5c8cc4b45021)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashtek-mc%2Fhashgui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashtek-mc%2Fhashgui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashtek-mc%2Fhashgui/lists"}