{"id":27017974,"url":"https://github.com/mulverinex/player_input","last_synced_at":"2026-02-12T15:06:34.773Z","repository":{"id":264516632,"uuid":"862383915","full_name":"MulverineX/player_input","owner":"MulverineX","description":"Handles polling based input detection, made possible by the type-specific input field on players, provides easy \u0026 useful DX for tracking and acting on changes in this data.","archived":false,"fork":false,"pushed_at":"2025-11-18T19:21:05.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T03:55:14.079Z","etag":null,"topics":["datapack","datapack-library","minecraft"],"latest_commit_sha":null,"homepage":"https://smithed.net/packs/player_input","language":"mcfunction","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/MulverineX.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,"zenodo":null}},"created_at":"2024-09-24T14:05:00.000Z","updated_at":"2025-11-18T19:18:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"c87a1241-8322-4a70-b894-bfddafd136e7","html_url":"https://github.com/MulverineX/player_input","commit_stats":null,"previous_names":["mulverinex/player_input"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MulverineX/player_input","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MulverineX%2Fplayer_input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MulverineX%2Fplayer_input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MulverineX%2Fplayer_input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MulverineX%2Fplayer_input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MulverineX","download_url":"https://codeload.github.com/MulverineX/player_input/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MulverineX%2Fplayer_input/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29369475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["datapack","datapack-library","minecraft"],"created_at":"2025-04-04T16:38:22.322Z","updated_at":"2026-02-12T15:06:34.758Z","avatar_url":"https://github.com/MulverineX.png","language":"mcfunction","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Player Input\nPlayer Input is a library specifically designed for handling polling based input detection, made possible by the type specific `input` field on players that gives us 20hz access to the keybinds `forward`, `backward`, `left`, `right`, `jump`, `sneak`, `sprint` at all times, in all game modes, regardless of context, except within GUIs.\n\nThe goal of this library is two fold:\n\n1. Optimize actionable retrieval of this data; many packs need this data but its worse for performance for all of them to be polling at the same time.\n2. Create easy \u0026 useful DX for tracking and acting on changes in this data.\n\n### Usage\n\nPacks that need access to this input data for few out of many players in specific scenarios should use the `capture/player` path to begin tracking of the data.\n\nPacks that need access to input data for most/all of players should use the `capture/players` path to begin tracking of the data, and call the `release/players` when the data is no longer needed (use `#minecraft:unload` if the data is needed all of the time)\n\nWhen data is being received, the exclusive `player_input.*` `/tag` labels are always made available.\n\nPacks that need to do their own custom tracking every tick regardless of if the binds change can use the `raw` entrypoint. If only some players need to be checked use the `#player_input:player/raw` function tag (called as/at each player) and use your own `/tag` label to filter players your pack is operating with as the function tag will be called for all usage of the library.\n\nEvents: \n\nThese entrypoints are called as/at players that match the required state along with context data made available to functions in each tag, enabling event-based handling, instead of checking for state every tick.\n\nTo subscribe to any of these, call the appropriate capture function, then to clean up after usage, call the release function.\n\nAs with `raw`, make sure to `/tag` players that your pack is specifically handling, as the function tag will be called for all usage of the library.\n\n- `key_update` - Called as/at players whose input stack has changed from the previous tick.\n    - Tracked via the exclusive `player_input.previous.*` `/tag` labels and the `player_input.current_tick`/`player_input.previous_tick` composite Scores on the player.\n    - This context is also available for the following events.\n- `key_down` - Called as/at players that **were not** holding down any given key(s) in the previous tick and started to.\n    - Tracked via the exclusive `player_input.down.*` `/tag` labels and the `keys_down player_input.current_tick` composite Score during execution.\n- `key_up` - Called as/at players that **were** holding down any given key(s) in the previous tick and released them.\n    - Tracked via the exclusive `player_input.up.*` `/tag` labels and the `keys_up player_input.current_tick` composite Score during execution.\n\n### Example\n\n`jetpack:jetpack/equip`\n```mcfunction\ntag @s add jetpack.equipped\n\nfunction player_input:capture/player/key_update\n\n# Jetpack Things...\n```\n\n`jetpack:input_received`\n```mcfunction\nexecute if entity @s[tag=jetpack.equipped] run function jetpack:jetpack/control\n```\n\n`jetpack:jetpack/control`\n```mcfunction\n# Handle changes to player input\n```\n\n`jetpack:jetpack/unequipped`\n```mcfunction\ntag @s remove jetpack.equipped\n\nfunction player_input:release/player/key_update\n\n# Jetpack Things...\n```\n\n`#player_input:player/key_update`\n```json\n{\n    \"values\": [\n        \"jetpack:input_received\"\n    ],\n    \"replace\": false\n}\n```\n\n### Plans\n- Create a couple full proof-of-concept survival packs using this library and Player Motion.\n- Reimplement in the Sandstone official `player` library\n- Create a vanilla usage harness and deploy it to this repo\n- Archive the current manually written vanilla code, automatically publish generated code to this repository.\n- Port proof-of-concept packs to Sandstone. \n- Maintain for changes in minecraft updates.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulverinex%2Fplayer_input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmulverinex%2Fplayer_input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmulverinex%2Fplayer_input/lists"}