{"id":16377863,"url":"https://github.com/phoenix616/hook","last_synced_at":"2026-04-11T20:39:00.290Z","repository":{"id":41479110,"uuid":"261240826","full_name":"Phoenix616/hook","owner":"Phoenix616","description":"Library to simplify hooking into other plugins.","archived":false,"fork":false,"pushed_at":"2022-06-25T19:08:33.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T13:43:43.046Z","etag":null,"topics":["bukkit","bungee","hook","library","minecraft","spigot"],"latest_commit_sha":null,"homepage":"https://wiki.phoenix616.dev/library:hook:","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/Phoenix616.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}},"created_at":"2020-05-04T16:41:17.000Z","updated_at":"2022-07-02T16:54:19.000Z","dependencies_parsed_at":"2022-09-02T13:11:28.457Z","dependency_job_id":null,"html_url":"https://github.com/Phoenix616/hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phoenix616%2Fhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phoenix616%2Fhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phoenix616%2Fhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Phoenix616%2Fhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Phoenix616","download_url":"https://codeload.github.com/Phoenix616/hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240002100,"owners_count":19732164,"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":["bukkit","bungee","hook","library","minecraft","spigot"],"created_at":"2024-10-11T03:44:07.266Z","updated_at":"2025-10-17T19:20:42.490Z","avatar_url":"https://github.com/Phoenix616.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hook\n\nLibrary to simplify hooking into other plugins.\n\nCurrently (directly) supports Bukkit, Bungee and Velocity, adding your own is easily\npossible though by simply implementing the AbstractHookManager.\n\n## How to use it\n\nDepend on one of the adapters or implement the AbstrackHookManager for your platform. \nThen shade it in and (ideally) relocate it in your own package.\n\nNow just create classes extending `de.themoep.hook.core.Hook` named after your plugin\nin the package you defined in the constructor of your HookManager.\nIf you specified that each hook should have its own package then the manager will\nsearch for hook classes in packages named after the plugin.\n\nBesides simple plugin names the manager will also search for hook classes matching the\nplugin's version. That way hooking into multiple versions of the same plugin becomes\npossible.\n\nSee the [Javadocs](https://docs.phoenix616.dev/hook/) for code specifications.\n\n### Examples\n\nExample classes that are checked starting from the provided hookPackage root \nwithout specifying per-hook package mode and the default `\"Hook\"` suffix:\n\n| Plugin     | Version                 | Checked class paths                      |\n|------------|-------------------------|------------------------------------------|\n| Factions   | 1.6.9.5-U0.2.1-SNAPSHOT | Factions1_6_9_U0_2_1_SNAPSHOTHook.class  |\n|            |                         | Factions1_6_9_U0_2Hook.class             |\n|            |                         | Factions1_6_9Hook.class                  |\n|            |                         | Factions1_6Hook.class                    |\n|            |                         | Factions1Hook.class                      |\n|            |                         | FactionsHook.class                       |\n| Factions   | 2.12.0                  | FactionsHook2_12_0.class                 |\n|            |                         | FactionsHook2_12.class                   |\n|            |                         | FactionsHook2.class                      |\n|            |                         | FactionsHook.class                       |\n| WorldGuard | 6.1.1-SNAPSHOT          | WorldGuard6_1Hook.class                  |\n|            |                         | WorldGuard6Hook.class                    |\n| WorldGuard | 7.2.0-SNAPSHOT          | WorldGuard7_2Hook.class                  |\n|            |                         | WorldGuard7Hook.class                    |\n|            |                         | WorldGuardHook.class                     |\n\nIt will basically replace all non-word characters (`\\W` regex) with underscores to make\nlegal path and package names. Of course the table does not list all possible combinations.\n\nThe same logic will be used in *per-hook package mode*. In that mode the package name will\nhave the dynamic path including the version string (plugin name and version will be\nlowercase in the path). The actual class name should there be `PluginNameHook.class` \n(with the default `\"Hook\"` suffix).\n\nE.g. for WorldGuard 7.2.0-SNAPSHOT a possible hook path would be `your.hook.package.root.worldguard7_2.WorldGuardHook.class`.\n\n### Maven information\n\n#### Repository:\n\n```xml\n\u003crepository\u003e\n    \u003cid\u003ehook-repo\u003c/id\u003e\n    \u003curl\u003ehttps://repo.minebench.de/\u003c/url\u003e\n\u003c/repository\u003e\n```\n\n#### Bukkit adapter:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.themoep.hook\u003c/groupId\u003e\n    \u003cartifactId\u003ehook-bukkit\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003cversion\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n#### Bungee adapter:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.themoep.hook\u003c/groupId\u003e\n    \u003cartifactId\u003ehook-bungee\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003cversion\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n#### Velocity adapter:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.themoep.hook\u003c/groupId\u003e\n    \u003cartifactId\u003ehook-velocity\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003cversion\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n#### Core for implementing AbstractHookManager:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ede.themoep.hook\u003c/groupId\u003e\n    \u003cartifactId\u003ehook-core\u003c/artifactId\u003e\n    \u003cversion\u003e1.0-SNAPSHOT\u003cversion\u003e\n    \u003cscope\u003ecompile\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## License\n\n```\nhook - library to manage hooking into other plugins\nCopyright (c) 2020 Max Lee aka Phoenix616 (mail@moep.tv)\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenix616%2Fhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoenix616%2Fhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoenix616%2Fhook/lists"}