{"id":21355534,"url":"https://github.com/owengregson/strikesync","last_synced_at":"2025-10-25T05:19:12.654Z","repository":{"id":251467942,"uuid":"837512293","full_name":"owengregson/StrikeSync","owner":"owengregson","description":"Asynchronous hit registration and knockback for modern Minecraft.","archived":false,"fork":false,"pushed_at":"2024-08-03T08:02:58.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T05:26:27.866Z","etag":null,"topics":["async","async-hit-reg","asynchronous-hit-registration","asynchronous-requests","bukkit-plugin","hit-reg","hit-registration","minecraft","minecraft-plugin","paper-plugin","spigot-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/owengregson.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":"2024-08-03T07:36:56.000Z","updated_at":"2024-08-03T08:03:00.000Z","dependencies_parsed_at":"2024-08-03T08:46:36.227Z","dependency_job_id":"b447ae57-a8d8-4b6a-89fd-71f5feb3fd13","html_url":"https://github.com/owengregson/StrikeSync","commit_stats":null,"previous_names":["owengregson/strikesync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owengregson/StrikeSync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owengregson%2FStrikeSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owengregson%2FStrikeSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owengregson%2FStrikeSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owengregson%2FStrikeSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owengregson","download_url":"https://codeload.github.com/owengregson/StrikeSync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owengregson%2FStrikeSync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280906433,"owners_count":26411415,"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-25T02:00:06.499Z","response_time":81,"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":["async","async-hit-reg","asynchronous-hit-registration","asynchronous-requests","bukkit-plugin","hit-reg","hit-registration","minecraft","minecraft-plugin","paper-plugin","spigot-plugin"],"created_at":"2024-11-22T04:18:14.836Z","updated_at":"2025-10-25T05:19:12.617Z","avatar_url":"https://github.com/owengregson.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StrikeSync\nAsynchronous hit registration and knockback for modern Minecraft.\n\nNote that this this plugin is experimental and any builds here serve as a beta release. Please report bugs if you encounter them!\n\n## The Problem with Normal Hit Registration\nMinecraft registers and processes hits in the main thread, ticking at a rate of 20 ticks-per-second (TPS), or 50ms per tick.\nThis means that hits may be unnecessarily delayed by up to 50 milliseconds! This is especially noticeable during combat where timing is critical to the outcome of the fight.\nAdditionally, Minecraft includes a (relatively low) max clicks-per-second (CPS) limit built-in to the server.\nThis plugin removes the limit so that hits may be processed on-demand at any time. That doesn't mean that players will experience unusual hit behavior, it will merely feel more responsive in PvP.\n\n## How does StrikeSync solve this?\nStrikeSync asynchronously listens for hit requests and processes them independently of the tick stack!\nActual damage, knockback, etc. MUST still be synchronized to the Minecraft server and applied on the next tick in the tick stack, though, as damaging players isn't thread-safe.\nHowever, both the animation and hit registration are carried out by StrikeSync.\n\n## How does the tick stack work, and how does it relate to this plugin?\nThe Minecraft server has a \"stack\" of operations to carry out, called the \"tick stack.\"\nWhen new operations need to be performed, such as spawning mobs or damaging a player, they are added to the tick stack.\nThe tick stack is processed 20 times every second, or 20 TPS. This means if you were to hit someone at the beginning of a tick, the server might not actually register anything until 50ms later.\nThis is especially noticeable during combat where timing is critical to the outcome of the fight. A few big PvP Practice servers implemented a similar version of this system hardcoded into their server jar.\n\n## Asynchronous Events\nSince async listener occurs outside of the main thread, we provide a separate event for cancelling StrikeSync's hit-registration.\nTo do this, you can use and hook into the `AsyncHitRegisterEvent`. Remember, though, that your listener is invoked asynchronously,\ntherefore you may NOT safely write to the Bukkit API or perform other actions which must occur on the main thread. See Bukkit documentation\nfor more information on this.\n\nHere is an example code snippet to cancel hits in a protected WorldGuard region:\n\n```java\nclass WorldGuardListener implements Listener {\n    WorldGuardPlugin wg = (WorldGuardPlugin) Bukkit.getServer().getPluginManager().getPlugin(\"WorldGuard\");\n\n    @EventHandler\n    public void AsyncHitRegisterEvent(AsyncHitRegisterEvent e) {\n        Player damager = e.getDamager();\n        Damageable entity = e.getEntity();\n        World world = damager.getWorld();\n        RegionManager rgMgr = wg.getRegionManager(world);\n\n        boolean damagerCanDamage = rgMgr.getApplicableRegions(damager.getLocation()).testState( wg.wrapPlayer(damager), DefaultFlag.PVP)\n        boolean entityIsDamageable = rgMgr.getApplicableRegions(entity.getLocation()).testState( wg.wrapPlayer(damager), DefaultFlag.PVP)\n        if(!damagerCanDamage || !entityIsDamageable) {\n            e.setCancelled(true);\n        }\n    }\n\n}\n```\n\n## Notes\nBack in 2016, another GitHub user by the name of frash23 attempted to implement a similar asynchronous hit processing technique in his plugin SmashHit.\nUnfortunately, his plugin did not work exactly as described and only supports ancient, unsupported versions of Minecraft from pre-1.10.\nHence, I have recoded the system for modern versions and worked to ensure it works as intended. I still want to thank frash23 for inspiring me to make this project!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowengregson%2Fstrikesync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowengregson%2Fstrikesync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowengregson%2Fstrikesync/lists"}