{"id":16909389,"url":"https://github.com/jumanji144/picocli-minecraft","last_synced_at":"2025-10-26T08:04:46.675Z","repository":{"id":119790168,"uuid":"549628414","full_name":"jumanji144/picocli-minecraft","owner":"jumanji144","description":"A Small and simple wrapper around picocli as a minecraft command system","archived":false,"fork":false,"pushed_at":"2022-10-13T10:35:23.000Z","size":110,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T17:46:40.135Z","etag":null,"topics":["bukkit","bukkit-plugin","command-line","gradle","java","minecraft","minecraft-plugin","picocli"],"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/jumanji144.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}},"created_at":"2022-10-11T13:38:27.000Z","updated_at":"2022-12-06T00:35:46.000Z","dependencies_parsed_at":"2023-03-24T05:33:41.242Z","dependency_job_id":null,"html_url":"https://github.com/jumanji144/picocli-minecraft","commit_stats":null,"previous_names":["jumanji144/picocli-minecraft"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jumanji144/picocli-minecraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jumanji144%2Fpicocli-minecraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jumanji144%2Fpicocli-minecraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jumanji144%2Fpicocli-minecraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jumanji144%2Fpicocli-minecraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jumanji144","download_url":"https://codeload.github.com/jumanji144/picocli-minecraft/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jumanji144%2Fpicocli-minecraft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281074164,"owners_count":26439421,"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-26T02:00:06.575Z","response_time":61,"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":["bukkit","bukkit-plugin","command-line","gradle","java","minecraft","minecraft-plugin","picocli"],"created_at":"2024-10-13T18:55:36.125Z","updated_at":"2025-10-26T08:04:46.661Z","avatar_url":"https://github.com/jumanji144.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Picocli Minecraft\n[![](https://jitpack.io/v/Nowilltolife/picocli-minecraft.svg)](https://jitpack.io/#Nowilltolife/picocli-minecraft)\n[![](https://img.shields.io/github/license/Nowilltolife/picocli-minecraft)](https://github.com/Nowilltolife/picocli-minecraft)\n\nThis project is small wrapper around [picocli](https://github.com/remkop/picocli) in the use of a command system.\n\n- [Usage](#usage)\n    - [Bukkit](#bukkit)\n    - [BungeeCord](#bungeecord)\n- [Examples](#examples)\n- [Installation](#installation)\n    - [Maven](#maven)\n    - [Gradle](#gradle)\n- [Credits](#credits)\n\n## Usage\nThe command system is highly oriented around the already existing picocli syntax with a few extra added things.     \nTo register commands you must create a class that extends the respective platform base. After that picocli syntax can follow, with the\nexception that there is an added annotation `@Permission` that can be added to `@Command` annotated classes or methods that will check for the\ngiven permission before execution.       \nFor execution the `Base` class requires you to implement the `int execute()` method. For context related values the respetive \nExample for bukkit:\n```java\n@Command(\n        name = \"teleport\",\n        description = \"Teleport players to a location\",\n        mixinStandardHelpOptions = true\n)\n@Permission(permission = \"teleport.use\")\npublic class TeleportCommand extends BukkitBase {\n\n    @Option(names = {\"-p\"}, description=\"Player to teleport to\", required=true)\n    private Player p;\n    \n    public int execute() {\n        if(getSender() instanceof Player) {\n            ((Player)getSender()).teleport(p);\n        }\n    }\n\n}\n```\nTo then register the commands a `CommandManager` must be created and given a platform respective `ICommandRegistrar`.    \n### Bukkit\n```java\npublic final class Test extends JavaPlugin {\n\n    @Override\n    public void onEnable() {\n        CommandManager manager = new CommandManager(new BukkitCommandRegistrar(this));\n        manager.register(new TeleportCommand());\n    }\n\n    @Override\n    public void onDisable() {\n        // Plugin shutdown logic\n    }\n}\n```\n### BungeeCord\n```java\npublic final class Test extends Plugin {\n\n    @Override\n    public void onEnable() {\n        CommandManager manager = new CommandManager(new BungeeCommandRegistrar(this));\n        manager.register(new TeleportCommand());\n    }\n\n    @Override\n    public void onDisable() {\n        // Plugin shutdown logic\n    }\n}\n```\n`CommandManager` also allows you to define the help color scheme via `setColorScheme`\n## Examples\n`SpawnCommand`\n```java\n@Command(\n        name = \"spawn\",\n        description = \"Spawn entities or blocks\"\n)\npublic class SpawnCommand extends BukkitBase {\n\n    @Command(\n            name = \"entity\",\n            description = \"Spawn an entity\"\n    )\n    public int spawnEntity(@Parameters(paramLabel = \"type\", description = \"The entity type to spawn\") EntityType type) {\n        if(getSender() instanceof Player) {\n            Player player = (Player) getSender();\n            player.getWorld().spawnEntity(player.getLocation(), type);\n            return 0;\n        } else {\n            getSender().sendMessage(\"You must be a player to use this command\");\n            return 1;\n        }\n    }\n\n    @Command(\n            name = \"block\",\n            description = \"Spawn a block\"\n    )\n    public int spawnBlock(@Parameters(paramLabel = \"type\", description = \"The block type to spawn\") Material material) {\n        if(getSender() instanceof Player) {\n            Player player = (Player) getSender();\n            player.getWorld().getBlockAt(player.getLocation()).setType(material);\n            return 0;\n        } else {\n            getSender().sendMessage(\"You must be a player to use this command\");\n            return 1;\n        }\n    }\n\n    @Override\n    public int execute() {\n        // make it show the help message\n        throw new ParameterException(getCommandLine(), \"You must specify a subcommand\");\n    }\n}\n```\n`TeleportCommand`\n```java\n@Command(\n        name = \"teleport\",\n        description = \"Teleport players to a location\",\n        mixinStandardHelpOptions = true\n)\npublic class TeleportCommand extends BukkitBase {\n\n    @Parameters(description = \"The x coordinate to teleport to\", arity = \"0..1\", defaultValue = \"_NULL_\")\n    Optional\u003cDouble\u003e x;\n\n    @Parameters(description = \"The y coordinate to teleport to\", arity = \"0..1\", defaultValue = \"_NULL_\")\n    Optional\u003cDouble\u003e y;\n\n    @Parameters(description = \"The z coordinate to teleport to\", arity = \"0..1\", defaultValue = \"_NULL_\")\n    Optional\u003cDouble\u003e z;\n\n    @Option(names = {\"-p\", \"--player\"}, description = \"The player to teleport\", arity = \"0..1\", defaultValue = \"_NULL_\")\n    Optional\u003cPlayer\u003e player;\n\n    @Option(names = {\"-w\", \"--world\"}, description = \"The world to teleport to\", arity = \"0..1\", defaultValue = \"_NULL_\")\n    Optional\u003cWorld\u003e world;\n\n\n    @Override\n    public int execute() {\n        Player executor = null;\n        if(getSender() instanceof Player) {\n            executor = (Player) getSender();\n        }\n        Player target = player.orElse(executor);\n        if(target == null) {\n            getSender().sendMessage(ChatColor.RED + \"You must be a player to use this command\");\n            return 1;\n        }\n        World world = this.world.orElseGet(target::getWorld);\n        if(x.isPresent() \u0026\u0026 y.isPresent() \u0026\u0026 z.isPresent()) {\n            target.teleport(new Location(world, x.get(), y.get(), z.get()));\n        } else {\n            if(target != executor) {\n                target.teleport(executor);\n            } else {\n                if(player.isPresent()) {\n                    getSender().sendMessage(ChatColor.RED + \"You cannot teleport to yourself!\");\n                } else {\n                    throw new ParameterException(getCommandLine(), \"You must specify a location to teleport to\");\n                }\n            }\n        }\n        return 0;\n    }\n}\n```\n\n## Installation\nTo use this library in your own project you must add the following based on your platform:   \n### Maven\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.Nowilltolife\u003c/groupId\u003e\n        \u003cartifactId\u003epicocli-minecraft\u003c/artifactId\u003e\n        \u003cversion\u003e1.1.1-beta\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n### Gradle\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n```groovy\ndependencies {\n    implementation 'com.github.Nowilltolife:picocli-minecraft:1.1.1-beta'\n}\n```\n## Credits\n- [picocli](https://github.com/remkop/picocli)\n- [objectweb](https://asm.ow2.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjumanji144%2Fpicocli-minecraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjumanji144%2Fpicocli-minecraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjumanji144%2Fpicocli-minecraft/lists"}