{"id":19549381,"url":"https://github.com/hanbings/alkaid","last_synced_at":"2025-10-12T17:31:47.733Z","repository":{"id":40434447,"uuid":"478124637","full_name":"hanbings/alkaid","owner":"hanbings","description":"🌟 Alkaid - 摇光 一只可以帮助你进行 Bukkit 插件开发的狼龙！A kemono wolf-dragon that can help you with Bukkit plugin development !","archived":false,"fork":false,"pushed_at":"2024-08-02T06:33:03.000Z","size":792,"stargazers_count":90,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-05T17:11:29.872Z","etag":null,"topics":["alkaid","bukkit","bungeecord","functional-programming","java","lambda","library","minecraft","mongodb","paper","redis","spigot","spigot-plugin","stream","tool"],"latest_commit_sha":null,"homepage":"https://alkaid.alkaidmc.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanbings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-04-05T12:45:27.000Z","updated_at":"2025-04-02T14:30:13.000Z","dependencies_parsed_at":"2023-12-15T12:26:06.618Z","dependency_job_id":"0e9af683-b1dc-48e6-b0d0-25105012c0b7","html_url":"https://github.com/hanbings/alkaid","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hanbings/alkaid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanbings%2Falkaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanbings%2Falkaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanbings%2Falkaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanbings%2Falkaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanbings","download_url":"https://codeload.github.com/hanbings/alkaid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanbings%2Falkaid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279012191,"owners_count":26085079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["alkaid","bukkit","bungeecord","functional-programming","java","lambda","library","minecraft","mongodb","paper","redis","spigot","spigot-plugin","stream","tool"],"created_at":"2024-11-11T03:59:56.184Z","updated_at":"2025-10-12T17:31:47.305Z","avatar_url":"https://github.com/hanbings.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Alkaid](https://picture.hanbings.com/2022/07/29/84aa54b568322.png)\n\n\u003ch1 align=\"center\"\u003e🌟 Alkaid\u003c/h1\u003e\n\u003ch5 align=\"center\"\u003eA Lightweight Kit Assisting In Developing.\u003c/h5\u003e\n\u003ch5 align=\"center\"\u003e🚧 It will be released soon, before which please do not use it in production environments. Thanks for your support!\u003c/h5\u003e\n\n[[English]](./README.md) [[简体中文]](./README.zh-CN.md)\n\n## 🍀 What is this?\n\nA utility library wrapping Bukkit, BungeeCord, as well as other Minecraft server-side APIs in future plans.\n\n**Target:**\n\n1. A set of Bukkit API secondly wrapped with Java\n2. More friendly API forms: chain calls and streams\n3. Detailed documentation and Javadocs helping users understand and use the code\n4. As low coupling as possible\n5. The smallest possible final package volume\n\n**Table of Contents:**\n\n- What is this?\n- Quick start\n- Instructions for use\n- Example\n- Module\n- Plan\n- Documentation\n- Contribution (PR, Issue and other forms of contribution)\n- Code of Conduct\n- Open Source License\n- About Open Source\n\n## ⚡️ Quick start\n\nCurrently Alkaid Lib is released at https://repository.alkaidmc.com\n\nThis requires adding a custom repository through Maven or Gradle and then adding the corresponding module dependencies:\n\n**Maven**\n\n```xml\n\u003crepository\u003e\n  \u003cid\u003ealkaidmc-repository-releases\u003c/id\u003e\n  \u003cname\u003eAlkaidMC Repository\u003c/name\u003e\n  \u003curl\u003ehttps://repository.alkaidmc.com/releases\u003c/url\u003e\n\u003c/repository\u003e\n\n\u003crepository\u003e\n  \u003cid\u003ealkaidmc-repository-snapshots\u003c/id\u003e\n  \u003cname\u003eAlkaidMC Repository\u003c/name\u003e\n  \u003curl\u003ehttps://repository.alkaidmc.com/snapshots\u003c/url\u003e\n\u003c/repository\u003e\n```\n\n**Gradle**\n\n```groovy\nmaven { url \"https://repository.alkaidmc.com/releases\" }\nmaven { url \"https://repository.alkaidmc.com/snapshots\" }\n```\n\n**Gradle Kotlin**\n\n```kotlin\nmaven { url = uri(\"https://repository.alkaidmc.com/releases\") }\nmaven { url = uri(\"https://repository.alkaidmc.com/snapshots\") }\n```\n\n## 🚀 Instructions for use\n\n**Compile**: Build using Gradle.\n\n```bash\n# clone from our repository.\n$ git clone https://github.com/hanbings/alkaid\n# source dir.\n$ cd alkaid\n# complie and package with gradle build.\n$ gradle build\n```\n\n## ✨ Example\n\n**Let's do some simple event monitoring**\n\nUsing the chain API provided by Alkaid can save the troublesome steps of inheritance and rewriting that were originally required to define listeners using the Bukkit API.\n\n```java\nnew AlkaidEvent(plugin).simple()\n        // event\n        .event(PlayerJoinEvent.class)\n        // event handler\n        .listener(event -\u003e {\n        \tevent.getPlayer().sendMessage(\"Welcome!\");\n        })\n        // event priority\n        .priority(EventPriority.HIGHEST)\n        // ignore cancel\n        .ignore(false)\n        // register to bukkit\n        .register();\n```\n\n**Event Section**\n\nThe event section consists of head event - main logic event handler - tail event.\n\nThe event handler will not be executed until the head event is monitored, and finally the tail event will suspend the listener until the next head event is detected and the Section will be restarted.\n\n```java\nnew AlkaidEvent(plugin).section()\n        .event(PlayerBedEnterEvent.class)\n        .listener(event -\u003e {\n            event.getPlayer().sendMessage(\"Good night!\");\n        })\n        // Each entity is processed separately, that is to say, each entity corresponds to a Section. \n        // After opening, the section only accepts events that inherit PlayerEvent or EntityEvent.\n        .entity(true)\n        // Filter events that do not match the criteria.\n        .filter(event -\u003e event.getPlayer().isSleeping())\n        // Start listening when this event is heard.\n        .commence(PlayerBedEnterEvent.class)\n        // Stop listening when listening to this event.\n        .interrupt(PlayerBedLeaveEvent.class)\n        .ignore(true)\n        .priority(EventPriority.HIGHEST)\n        .register();\n```\n\n**Register Command**\n\n```java\nnew AlkaidCommand(plugin).simple()\n         .command(\"alkaid\")\n         .description(\"Alkaid\")\n         .permission(\"alkaid.permission\")\n         .usage(\"/alkaid\")\n         .aliases(List.of(\"alias\"))\n         .executor((sender, command, label, args) -\u003e {\n         \tsender.sendMessage(\"Hello！\");\n            return true;\n         })\n         .tab((sender, command, alias, args) -\u003e List.of(\"Hello\"))\n         .register();\n```\n\n**Register Task**\n\n```java\nnew AlkaidTask(plugin).simple()\n         .run(() -\u003e System.out.println(\"This is a task.\"))\n         .delay(20)\n         .period(20)\n         .async(true)\n         .register();\n```\n\n**Create a Book**\n\n```java\nnew AlkaidInventory(plugin).book()\n        .title(\"The title\")\n        .author(\"author\")\n        .write(\"This is a sentence written in the book.\")\n        .write(2, \"This is a sentence written on the third page of the book.\")\n        // get itemStack\n        .written();\n```\n\n**Custom Inventory**\n\n```java\nItemStack book = new ItemStack(Material.BOOK);\nItemStack glass = new ItemStack(Material.BLUE_STAINED_GLASS_PANE);\n\nCustomInventory.ItemStackAction action = new CustomInventory.ItemStackAction()\n        .click(e -\u003e this.getLogger().info(\"click\"))\n        .left(e -\u003e this.getLogger().info(\"left\"))\n        .right(e -\u003e this.getLogger().info(\"right\"))\n        .drag(e -\u003e this.getLogger().info(\"drag\"))\n        .update(e -\u003e this.getLogger().info(\"update\"));\n\n@SuppressWarnings(\"all\")\nInventory inventory = new AlkaidInventory(this).gui()\n        .title(\"Alkaid Custom Inventory\")\n        .rows(5)\n        .interval(2000)\n        .structure(\n            List.of(\n                \"#########\",\n                \"####A####\",\n                \"#########\",\n                \"#BBBBBBB#\",\n                \"#########\"\n            ),\n            Map.of(\n                '#', new CustomInventory.ItemStackRegister(glass, action),\n                'A', new CustomInventory.ItemStackRegister(book, action),\n                'B', new CustomInventory.ItemStackRegister(\n                    (slot, index) -\u003e new ItemStackBuilder()\n                        .of(Material.PAPER)\n                        .display(\"I'm number %d!\".formatted(index + 1))\n                        .item(),\n                    (slot, index) -\u003e action\n                )\n            )\n        )\n        .open(e -\u003e ((Player) e.getPlayer()).playSound(e.getPlayer().getLocation(), \"minecraft:block.note_block.pling\", 1, 1))\n        .close(e -\u003e ((Player) e.getPlayer()).playSound(e.getPlayer().getLocation(), \"minecraft:block.note_block.pling\", 1, 1))\n        .click(e -\u003e {\n            if (e.getClickedInventory() == null) return;\n            if (e.getClickedInventory().getHolder() instanceof Player) return;\n            e.setCancelled(true);\n        })\n        .drag(e -\u003e e.setCancelled(true))\n        .update((custom, inv, registries) -\u003e {\n            return registries;\n        })\n        .inventory();\n```\n\n**ItemStack Builder**\n\n```java\nnew AlkaidInventory(plugin).item()\n        // Creates a new ItemStackBuilder from an existing ItemStack ItemMeta or Material.\n        .of(Material.DIAMOND_SWORD)\n        .of(new ItemStack(Material.DIAMOND_SWORD))\n        // set amount\n        .amount(1)\n        // add enchantment\n        .enchantment(Enchantment.DAMAGE_ALL, 1)\n        // flag\n        .flag(ItemFlag.HIDE_ENCHANTS)\n        // display name\n        .display(\"This is a item\")\n        // Add lore or add multiple lines of lore.\n        .lore(\"A Diamond Sword\")\n        .lore(\"Diamond\", \"Sword\")\n        // localizetion key\n        .localized(\"alkaid.inventory.diamond.sword\")\n        // custom model data\n        .model(1)\n        // Sets the item's unbreakable tag.\n        .unbreakable(false)\n        .item();\n```\n\n**Json Message**\n\n```java\nnew AlkaidMessage(plugin).text()\n        .append(it -\u003e it.text(\"Hello\")\n            .yellow()\n            .bold()\n            .underlined()\n            .hover(hover -\u003e hover.text(\"一眼翻译，鉴定为：再见\")))\n            // full ver: ... hover.text().text(\"一眼翻译，鉴定为：再见\") ...\n        .red(\", \")\n        .text(\"World\", \"#E682A0\", Format.BOLD)\n        .components();\n```\n\n\u003cdetails\u003e\n\n\u003csummary\u003e生成效果\u003c/summary\u003e\n\n![效果图](https://picture.hanbings.com/2022/05/08/56562eb28cce1.png)\n\n```json\n{\n\t\"extra\": [{\n\t\t\"bold\": true,\n\t\t\"underlined\": true,\n\t\t\"color\": \"yellow\",\n\t\t\"hoverEvent\": {\n\t\t\t\"action\": \"show_text\",\n\t\t\t\"contents\": [{\n\t\t\t\t\"extra\": [{\n\t\t\t\t\t\"text\": \"一眼翻译，鉴定为：再见\"\n\t\t\t\t}],\n\t\t\t\t\"text\": \"\"\n\t\t\t}]\n\t\t},\n\t\t\"extra\": [{\n\t\t\t\"text\": \"Hello\"\n\t\t}],\n\t\t\"text\": \"\"\n\t}, {\n\t\t\"color\": \"red\",\n\t\t\"text\": \", \"\n\t}, {\n\t\t\"bold\": true,\n\t\t\"color\": \"#E682A0\",\n\t\t\"text\": \"World\"\n\t}],\n\t\"text\": \"\"\n}\n```\n\n\u003c/details\u003e\n\n**Reflection**\n\n```java\nnew AlkaidCommon().reflection()\n        // set class\n        .clazz(AlkaidCommon.class)\n        // set classloader\n        .loader(this.getClass().getClassLoader())\n        // init class\n        .initialize(true)\n        // target method name\n        .method(\"test\")\n        // set instance\n        .instance(null)\n        // set calling args\n        .args(null)\n        // catch exception\n        .exception(Throwable::printStackTrace)\n        // result\n        .result(System.out::println)\n        // call\n        .call();\n```\n\n**File Watchdog**\n\n```java\nnew AlkaidCommon().filewatchdog()\n        .path(Paths.get(\"alkaid.txt\"))\n        // delay time / second\n        .delay(1000)\n        // status\n        .create(f -\u003e System.out.println(\"create\"))\n        .modify(f -\u003e System.out.println(\"modify\"))\n        .delete(f -\u003e System.out.println(\"delete\"))\n        // catch exception\n        .exception(e -\u003e System.out.println(\"exception\"))\n        .watch();\n```\n\n## 📦 Module\n\n| Module            | Description                   | Running in Bukkit | Running in Bungee Cord | Runs independently as a dependency |\n| ----------------- | ----------------------------- | ----------------- | ---------------------- | ---------------------------------- |\n| alkaid-bukkit     | Wrapper for Bukkit API        | ✔️                 | ❌                      | ❌                                  |\n| alkaid-bungeecord | Wrapper for Bungee Cord API   | ❌                 | ✔️                      | ❌                                  |\n| alkaid-common     | General Java language tools   | ✔️                 | ✔️                      | ✔️                                  |\n| alkaid-inventory  | Items and item containers     | ✔️                 | ❌                      | ❌                                  |\n| alkaid-log        | Logger and Log colors         | ✔️                 | ✔️                      | ✔️                                  |\n| alkaid-message    | Message                       | ✔️                 | ⭕️                      | ❌                                  |\n| alkaid-metadata   | NBT and Region file support   | ✔️                 | ❌                      | ❌                                  |\n| alkaid-mongodb    | MongoDB support               | ✔️                 | ✔️                      | ✔️                                  |\n| alkaid-organism   | Biological AI framework       | ✔️                 | ❌                      | ❌                                  |\n| alkaid-redis      | Redis support                 | ✔️                 | ✔️                      | ✔️                                  |\n| alkaid-world      | Dimensions, biomes and blocks | ✔️                 | ❌                      | ❌                                  |\n\n\u003ch6 align=\"center\"\u003e✔️ Supported ⭕️ Only Partially Supported ❌ Not Supported \u003c/h6\u003e\n\n## 🐌 Plan\n\nThrough the plan list, you can know what we are working on and what work we plan to do.\n\nPRs are welcome, but it's best to discuss them with us beforehand to avoid re-implementation.\n\n[Alkaid Development](https://github.com/AlkaidMC/alkaid/projects/1)\n\nIf you want us to implement some functions, you can tell us through Issue. There are some requirements for Issue / PR, please read on.\n\n## 📝 Documentation\n\nDetailed documentation is presented in Github Pages, and their source files are in the `docs` directory of this repository.\n\n[View Documentation](https://alkaid.alkaidmc.com/docs/#/)\n\n## 💬 Contribution\n\n**What is a contribution?**\n\nContributing is the process of assisting or participating in our development, including but not limited to reporting bugs to us, requesting reasonable new features, and submitting code.\n\nWe have some special requirements for Issue / PR and other possible contributions, please take a closer look, thanks for your support\n\n[View Contribution Guide](https://alkaid.alkaidmc.com/docs/#/zh-cn/contributing)\n\n## 🍺 Code of Conduct\n\nWe are writing a code of conduct...\n\n## ⚖ Open Source License\n\nThis project is open sourced using the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html) license agreement.\n\nThis project is a **non-profit** project.\n\nAccording to the agreement, this project **allows** commercial use** based on the project developed by this project under the premise of abiding by the agreement, but it should be noted that the pictures in this project (including the Alkaid displayed in the Readme.md file and other images that may appear) **Not part of the scope of open source**\nThey belong to the developer [Hanbings](https://github.com/hanbings), please **remove them** when copying or modifying this project.\n\n**Copyright Warning: The Alkaid font used in the mascot flutter image is a commercially licensed font Snap ITC**\n\n## 🍀 About Open Source\n\nOpen source is a spirit.\n\nPrinciples of the open source movement:\n\n1. Adhere to openness and sharing, and encourage maximum participation and collaboration.\n2. Respect the rights and interests of authors, while ensuring the integrity of the software program, encourage the freedom of modification and derivative innovation.\n3. Maintain independence and neutrality.\n\nDiscussing technical issues with developers from all over the world, solving technical problems and promoting the development of applications are the essential purposes of open source.\n\n**Everyone gathers firewood and the fire is high. Open source needs to rely on everyone's efforts. Please consciously abide by the open source agreement, promote the spirit of open source, and build an open source community together!**\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanbings%2Falkaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanbings%2Falkaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanbings%2Falkaid/lists"}