{"id":16379376,"url":"https://github.com/maxlego08/playeractionsapi","last_synced_at":"2026-01-02T23:49:51.498Z","repository":{"id":247600051,"uuid":"826303335","full_name":"Maxlego08/PlayerActionsAPI","owner":"Maxlego08","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-23T19:33:14.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-23T14:41:33.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Maxlego08.png","metadata":{"files":{"readme":"README.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-07-09T12:52:47.000Z","updated_at":"2024-07-24T21:08:02.000Z","dependencies_parsed_at":"2024-07-09T17:08:00.319Z","dependency_job_id":"57dea00e-ef8c-4d3f-ade0-b0053439dddb","html_url":"https://github.com/Maxlego08/PlayerActionsAPI","commit_stats":null,"previous_names":["maxlego08/playeractionsapi"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxlego08%2FPlayerActionsAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxlego08%2FPlayerActionsAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxlego08%2FPlayerActionsAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maxlego08%2FPlayerActionsAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maxlego08","download_url":"https://codeload.github.com/Maxlego08/PlayerActionsAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976485,"owners_count":20377691,"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":[],"created_at":"2024-10-11T03:48:21.973Z","updated_at":"2026-01-02T23:49:51.493Z","avatar_url":"https://github.com/Maxlego08.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlayerActionsAPI\n\nPlayer Actions API allows to transform a string list into a list of actions, send a message to the player, execute a\ncommand in the console etc.\nThis API uses the same syntax as DeluxeMenu.\n\n# Actions\n\n| Action      | Description                                                     |\n|-------------|-----------------------------------------------------------------|\n| [broadcast] | Broadcast a message to the server.                              |\n| [chat]      | Send a chat message as the player performing the action.        |\n| [close]     | Close the viewers open menu.                                    |\n| [console]   | Execute a command from the console.                             |\n| [message]   | Send a message to the menu viewer.                              |\n| [player]    | Execute a command from the player.                              |\n\nYou can add a tick delay to your action by using this: ``\u003cdelay:{ticks}\u003e``\nYou must set the delay after defining the action to perform.\n\n**Example**\n````yml\ncommands:\n  - \"[console] give %player% diamond\"\n  - \"[message] \u003cdelay:10\u003e \u0026bAction \u0026f\u0026l� \u0026fExample message\"\n````\n\n# Developer\n\nJitPack: https://jitpack.io/#Maxlego08/PlayerActionsAPI\n\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\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Maxlego08\u003c/groupId\u003e\n    \u003cartifactId\u003ePlayerActionsAPI\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n\u003c/dependency\u003e\n````\n# Gradle\n````kotlin\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        mavenCentral()\n        maven { url 'https://jitpack.io' }\n    }\n}\ndependencies {\n    implementation 'com.github.Maxlego08:PlayerActionsAPI:{version}'\n}\n````\n\n\nDo not forget to relocate the sources so as not to complicate with other plugin.\n\n## How to use\n\nThis configuration allows to execute a command and after a delay of 10 tickets to send a message\n````yml\ncommands:\n  - \"[console] give %player% diamond\"\n  - \"[message] \u003cdelay:10\u003e \u0026bAction \u0026f\u0026l� \u0026fExample message\"\n````\n\n### Load Actions\nThe first step and turn your string list into an action list.\n````java\npublic class Example extends JavaPlugin {\n\n    @Override\n    public void onEnable() {\n        List\u003cString\u003e commands = getConfig().getStringList(\"commands\");\n        List\u003cAction\u003e actions = ActionsAPI.loadActions(commands);\n    }\n}\n````\n\n### Use actions\nTo use the actions just run the `execute` method. The method requires a plugin and a player.\n````java\npublic class Example extends JavaPlugin {\n    \n    public void execute(List\u003cAction\u003e actions, Player player) {\n        actions.forEach(command -\u003e command.execute(this, player));\n    }\n}\n````\n\n### Register actions\nTo use the actions just run the `registerAction(JavaPlugin plugin, ActionType type)` method. The method requires a plugin and an action type.\n\n````java\npublic class CustomAction extends Action {\n\n    public CustomAction(int delay) {\n        super(delay);\n    }\n\n    @Override\n    protected Runnable getRunnableAction(Plugin plugin, Player player) {\n        return () -\u003e player.sendMessage(\"Hello, \" + player.getName() + \"!\");\n    }\n}\n````\n````java\npublic class CustomActionType implements ActionType {\n\n    @Override\n    public String getIdentifier() {\n        return \"[custom]\";\n    }\n\n    @Override\n    public Class\u003c? extends Action\u003e getAction() {\n        return CustomAction.class;\n    }\n}\n````\n````java\npublic class Example extends JavaPlugin {\n\n    public void onEnable() {\n        ActionsAPI.registerAction(this, new CustomActionType());\n        ActionsAPI.loadActions(\"[custom] \u003cdelay:20\u003e\");\n    }\n}\n````\n\nWith the method `registerAction(JavaPlugin plugin, ActionType type, Class\u003c? extends Action\u003e action)` you can override any action type already registered.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlego08%2Fplayeractionsapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxlego08%2Fplayeractionsapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxlego08%2Fplayeractionsapi/lists"}