{"id":20910263,"url":"https://github.com/toxicity188/bettercommand","last_synced_at":"2025-07-17T02:43:05.366Z","repository":{"id":260310480,"uuid":"880932287","full_name":"toxicity188/BetterCommand","owner":"toxicity188","description":"cross-platform command library implementing brigadier, adventure.","archived":false,"fork":false,"pushed_at":"2025-07-07T08:28:56.000Z","size":165,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T09:38:24.096Z","etag":null,"topics":["adventure","brigadier","command","library","minecraft","mod","plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/toxicity188.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2024-10-30T16:07:57.000Z","updated_at":"2025-07-07T08:29:00.000Z","dependencies_parsed_at":"2024-11-18T14:14:56.028Z","dependency_job_id":"d1eaebfb-9b91-495d-8db9-b0b6109da035","html_url":"https://github.com/toxicity188/BetterCommand","commit_stats":null,"previous_names":["toxicity188/bettercommand"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/toxicity188/BetterCommand","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxicity188%2FBetterCommand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxicity188%2FBetterCommand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxicity188%2FBetterCommand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxicity188%2FBetterCommand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toxicity188","download_url":"https://codeload.github.com/toxicity188/BetterCommand/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxicity188%2FBetterCommand/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265560988,"owners_count":23788288,"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","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":["adventure","brigadier","command","library","minecraft","mod","plugin"],"created_at":"2024-11-18T14:14:26.842Z","updated_at":"2025-07-17T02:43:05.341Z","avatar_url":"https://github.com/toxicity188.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BetterCommand\nA translatable command API that implements brigadier command node.  \nThe main propose of this project is **support cross-platform like Bukkit, Velocity and Fabric**.\n\n## Example source (Bukkit)\nYou can see this in CommandTest.java.\n```java\n//Create command\nvar command = library.\u003cCommandSourceStack, BetterCommandSource\u003emodule(\"mycommand\", p -\u003e {\n    var get = p.getBukkitSender();\n    if (get instanceof ConsoleCommandSender) return new CommandConsole();\n    else if (get instanceof Player player) return new CommandPlayer(player);\n    else throw new RuntimeException(\"Invalid sender.\");\n}).aliases(new String[] {\"my\"})\n        .executes(new CommandListener() {\n    @Command\n    @Description(key = \"test.print\", defaultValue = \"Shows 'hello world!'\")\n    @Permission(\"test.print\")\n    public void print(@Source BetterCommandSource me) {\n        me.audience().sendMessage(Component.text(\"Hello world!\"));\n    }\n\n    @Command\n    @Description(key = \"test.teleport\", defaultValue = \"Teleports to some location.\")\n    @Permission(\"test.teleport\")\n    @Aliases(aliases = \"tp\")\n    @Sender(type = SenderType.PLAYER)\n    public void teleport(@Source BetterCommandSource me, Location location) {\n        ((Player) me.audience()).teleport(location);\n        me.audience().sendMessage(Component.text(\"Go!\"));\n    }\n\n    @Command\n    @Description(key = \"test.generate\", defaultValue = \"Generates default lang file.\")\n    @Permission(\"test.generated\")\n    public void generate(@Source BetterCommandSource me) {\n        Bukkit.getScheduler().runTaskAsynchronously(CommandTest.this, () -\u003e {\n            if (library.generateDefaultLang(me.locale())) me.audience().sendMessage(Component.text(\"Successfully generated.\"));\n            else me.audience().sendMessage(Component.text(\"Generation failed.\"));\n        });\n    }\n\n    @Command\n    @Description(key = \"test.reload\", defaultValue = \"Reloads command.\")\n    @Permission(\"test.reload\")\n    public void reload(@Source BetterCommandSource me) {\n        Bukkit.getScheduler().runTaskAsynchronously(CommandTest.this, () -\u003e {\n            var state = library.reload();\n            if (state instanceof ReloadState.Success success) {\n                me.audience().sendMessage(Component.text(\"Reload completes: \" + success.time() + \" ms\"));\n            } else if (state instanceof ReloadState.Failure failure) {\n                me.audience().sendMessage(Component.text(\"Reload failures. Reason: \" + failure.exception().getClass().getSimpleName()));\n            } else if (state instanceof ReloadState.OnReload) {\n                me.audience().sendMessage(Component.text(\"Still on reload!\"));\n            }\n        });\n    }\n\n    @Command\n    @Description(key = \"test.test\", defaultValue = \"Test command.\")\n    @Permission(\"test.test\")\n    public void test(@Source BetterCommandSource me, String sender, @Vararg @Option String argus) {\n        me.audience().sendMessage(Component.text(sender + \": \" + argus));\n    }\n}).children(\"child\", children -\u003e children.permission(\"test.child\").executes(new CommandListener() {\n    @Command\n    @Description(key = \"test.child.die\", defaultValue = \"Die.\")\n    @Permission(\"test.child.die\")\n    @Sender(type = SenderType.PLAYER)\n    public void die(@Source BetterCommandSource me) {\n        ((Player) me.audience()).damage(9999);\n        me.audience().sendMessage(Component.text(\"Good bye!\"));\n    }\n}));\n```\n## Build\nRequired JDK 17.  \n./gradlew build","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxicity188%2Fbettercommand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoxicity188%2Fbettercommand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxicity188%2Fbettercommand/lists"}