{"id":21490097,"url":"https://github.com/mefrreex/chestcreator","last_synced_at":"2025-03-17T11:12:10.009Z","repository":{"id":211280106,"uuid":"728083366","full_name":"MEFRREEX/ChestCreator","owner":"MEFRREEX","description":"Tool for easy creation of chests in Json file for Nukkit","archived":false,"fork":false,"pushed_at":"2024-04-02T07:05:41.000Z","size":110,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T20:32:43.051Z","etag":null,"topics":["nukkit-plugin","pnx-plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MEFRREEX.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":"2023-12-06T07:35:52.000Z","updated_at":"2023-12-20T13:08:45.000Z","dependencies_parsed_at":"2023-12-07T15:31:08.205Z","dependency_job_id":"1eef55ce-3cfa-4a17-8f64-a6cf64d45e84","html_url":"https://github.com/MEFRREEX/ChestCreator","commit_stats":null,"previous_names":["mefrreex/chestcreator"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FChestCreator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FChestCreator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FChestCreator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FChestCreator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MEFRREEX","download_url":"https://codeload.github.com/MEFRREEX/ChestCreator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244022714,"owners_count":20385134,"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":["nukkit-plugin","pnx-plugin"],"created_at":"2024-11-23T14:30:42.890Z","updated_at":"2025-03-17T11:12:09.981Z","avatar_url":"https://github.com/MEFRREEX.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChestCreator\nTool for easy creation of chests in Json file for Nukkit\n\n\u003e [!IMPORTANT]\n\u003e This plugin is dependent on the [FakeInventories](https://github.com/IWareQ/FakeInventories) library\n\n## How to use\n\n\u003e All chests are stored in the plugins/ChestCreator/chests folder\n\nExample chest:\n\n`example.json`\n```json5\n{\n    // Command\n    \"command\": {\n        // Is enable\n        \"enable\": true,\n        \"name\": \"example\",\n        \"description\": \"Example command\", \n        // Command aliases\n        \"aliases\": [\"example1\"],\n        // Permission\n        // Delete it if you don't have to\n        \"permission\": \"chestcreator.example\"\n    },\n    // Chest title\n    \"title\": \"Example chest\",\n    // Inventory type\n    // Available: CHEST, DOUBLE_CHEST, HOPPER, DROPPER\n    \"type\": \"CHEST\",\n    // Mode of switching between chests\n    // Available: DEFAULT (default), REOPEN (before the new chest is opened, \n    // the current chest will be closed)\n    \"switchMode\": \"DEFAULT\",\n    // Chest items\n    \"items\": {\n        \"12\": { // \u003c-- Item slot\n            // Item id (Minecraft item id)\n            \"id\": \"minecraft:iron_sword\",\n            \"name\": \"First item\",\n            // Item lore\n            \"lore\": [\n                \"\u0026dHello, %player%\",\n                \"\u00266Click me!\"\n            ],\n            // Item actions\n            \"actions\": [\n                {\n                    // Available types: \n                    // PLAYER_COMMAND - Execute command from player\n                    // CONSOLE_COMMAND  - Execute command from server\n                    // MESSAGE - Send message to player\n                    // PLAYER_MESSAGE - Send message from player\n                    // OPEN_CHEST - Open other chest\n                    // OPEN_FORM - Open form from FormCreator\n                    \"type\": \"OPEN\",    // Type\n                    \"value\": \"example\" // Action value\n                }\n            ]   \n        },\n        \"14\": {\n            \"id\": \"minecraft:barrier\",\n            \"name\": \"Close\",\n            \"canTake\": false, // Can a player take an item\n            \"close\": true, // Close the chest after a click\n            \"lore\": [\"\u0026cClick to close\"],\n            \"actions\": [\n                {\n                    \"type\": \"PLAYER_COMMAND\",\n                    \"value\": \"say Test\"\n                }\n            ]\n        }\n    },\n    // Chest open actions\n    \"openActions\": [\n        {\n            \"type\": \"CONSOLE_COMMAND\",\n            \"value\": \"say %player% Chest opened!\"\n        }\n    ],\n    // Chest close actions\n    \"closeActions\": [\n        {\n            \"type\": \"CONSOLE_COMMAND\",\n            \"value\": \"say %player% Chest closed!\"\n        }\n    ]\n}\n```\nRegistration of the chest:\n\n`chests.yml`\n```yml\n# Registration of the chest\nchests:\n  # chest name: \"chest path in the 'chests' folder\"\n  example: \"example.json\"\n```\n\n## Commands\n| Name          | Sub Command | Usage                               | Description       | Permission        |\n|---------------|-------------|-------------------------------------|-------------------|-------------------|\n| /chestcreator | open        | /chestcreator open \u003cchest\u003e \u003cplayer\u003e | Open player chest | chestcreator.open |\n| /chestcreator | info        | /chestcreator info                  | Plugin info       | chestcreator.info |\n| /chestcreator | help        | /chestcreator help                  | Help              |                   |\n\n## API\n### ChestManager\nGet a folder with chests:\n```java\nFile folder = ChestManager.getChestsFolder();\n```\nGetting a chest by name:\n```java\nChest chest = ChestManager.get(\"chest_name\");\n```\nCheck the existence of the chest:\n```java\nChestManager.exists(\"chest_name\");\n```\nLoad chest from file:\n```java\nChestManager.load(\"chest_name\", file);\n```\n\n### Creating a custom action executor\n\nYour executor:\n```java\npublic class YourExecutor implements Executor {\n\n    /**\n     * @param player Player\n     * @param value  Value of action\n     */\n    @Override\n    public void execute(Player player, String value) {\n        // Handling action\n    }\n}\n```\n\nExecutor registration:\n```java\n// name - Executor name. For example: YOUR_EXECUTOR \nExecutorManager.register(\"name\", new YourExecutor());\n```\nGetting a executor:\n```java\nExecutorManager.getExecutor(\"YOUR_EXECUTOR\");\n```\n\n### Events\n| Name           | Cancellable | Description                      |\n|----------------|-------------|----------------------------------|\n| ChestLoadEvent | true        | Called when the chest is loaded  |\n| ChestSendEvent | true        | Called when a chest is opened    |\n\n# \n\n\u003e [!TIP]\n\u003e Chest slots identifiers\n\u003e \n\u003e ![image](https://github.com/MEFRREEX/ChestCreator/assets/83061703/95e27994-0668-4654-b41c-d846148550f4)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefrreex%2Fchestcreator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefrreex%2Fchestcreator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefrreex%2Fchestcreator/lists"}