{"id":47797342,"url":"https://github.com/26bz/minecraft-toolkit","last_synced_at":"2026-05-02T03:03:18.281Z","repository":{"id":342022802,"uuid":"1172268616","full_name":"26bz/minecraft-toolkit","owner":"26bz","description":"Developer toolkit for working with Mojang Minecraft player data, skins, and utilities.","archived":false,"fork":false,"pushed_at":"2026-03-27T20:06:07.000Z","size":137,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-03T18:41:24.397Z","etag":null,"topics":["minecraft","minecraft-api","minecraft-utilities"],"latest_commit_sha":null,"homepage":"https://www.npmx.dev/package/minecraft-toolkit","language":"JavaScript","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/26bz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"26bzz"}},"created_at":"2026-03-04T05:42:55.000Z","updated_at":"2026-03-27T20:06:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/26bz/minecraft-toolkit","commit_stats":null,"previous_names":["26bz/minecraft-toolkit"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/26bz/minecraft-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/26bz%2Fminecraft-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/26bz%2Fminecraft-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/26bz%2Fminecraft-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/26bz%2Fminecraft-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/26bz","download_url":"https://codeload.github.com/26bz/minecraft-toolkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/26bz%2Fminecraft-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32518890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["minecraft","minecraft-api","minecraft-utilities"],"created_at":"2026-04-03T16:33:30.584Z","updated_at":"2026-05-02T03:03:18.272Z","avatar_url":"https://github.com/26bz.png","language":"JavaScript","funding_links":["https://ko-fi.com/26bzz"],"categories":[],"sub_categories":[],"readme":"# minecraft-toolkit\n\n\u003c!-- automd:badges name=\"minecraft-toolkit\" github=\"26bz/minecraft-toolkit\" license --\u003e\n\n[![npm version](https://img.shields.io/npm/v/minecraft-toolkit)](https://npmjs.com/package/minecraft-toolkit)\n[![npm downloads](https://img.shields.io/npm/dm/minecraft-toolkit)](https://npm.chart.dev/minecraft-toolkit)\n[![license](https://img.shields.io/github/license/26bz/minecraft-toolkit)](https://github.com/26bz/minecraft-toolkit/blob/main/LICENSE)\n\n\u003c!-- /automd --\u003e\n\nLightweight Minecraft API + infrastructure toolkit: player profiles \u0026 textures, Java/Bedrock server status probes, and Votifier (v1/v2) clients that run in Node, Vite, and edge runtimes.\n\n\u003e This toolkit wraps Mojang APIs. Rate limits and availability still apply. Write endpoints (name change, skin upload) are not yet included.\n\n## Installation\n\n\u003c!-- automd:pm-install name=\"minecraft-toolkit\" --\u003e\n\n```sh\n# ✨ Auto-detect\nnpx nypm install minecraft-toolkit\n\n# npm\nnpm install minecraft-toolkit\n\n# yarn\nyarn add minecraft-toolkit\n\n# pnpm\npnpm install minecraft-toolkit\n\n# bun\nbun install minecraft-toolkit\n\n# deno\ndeno install minecraft-toolkit\n```\n\n\u003c!-- /automd --\u003e\n\n## Core Helpers\n\n```ts\nimport {\n  fetchPlayerProfile,\n  fetchPlayerSkin,\n  fetchPlayerUUID,\n  fetchPlayerSummary,\n  fetchNameHistory,\n  fetchPlayers,\n  resolvePlayer,\n  fetchSkinMetadata,\n} from \"minecraft-toolkit\";\n\nconst profile = await fetchPlayerProfile(\"26bz\");\nconst summary = await fetchPlayerSummary(\"26bz\");\nconst skin = await fetchPlayerSkin(\"26bz\");\nconst uuid = await fetchPlayerUUID(\"26bz\");\nconst history = await fetchNameHistory(\"069a79f444e94726a5befca90e38aaf5\");\nconst batch = await fetchPlayers([\"Notch\", \"26bz\"], { delayMs: 50 });\nconst resolved = await resolvePlayer(\"069a79f444e94726a5befca90e38aaf5\");\nconst skinMeta = await fetchSkinMetadata(\"26bz\");\n```\n\nHelpers are HTTP-agnostic and run anywhere `fetch` exists (Node 18+, Bun, Workers). All errors surface as `MinecraftToolkitError`.\n\n## Texture \u0026 Identity Utilities\n\n```ts\nimport {\n  isValidUsername,\n  isUUID,\n  normalizeUUID,\n  uuidWithDashes,\n  uuidWithoutDashes,\n  getSkinURL,\n  getCapeURL,\n  getSkinModel,\n  extractTextureHash,\n} from \"minecraft-toolkit\";\n\nisValidUsername(\"26bz\"); // true\nuuidWithDashes(\"069a79f444e94726a5befca90e38aaf5\");\nconst profile = await fetchPlayerProfile(\"26bz\");\nconst skinUrl = getSkinURL(profile);\nconst hash = extractTextureHash(skinUrl);\nconst model = getSkinModel(profile); // \"slim\" | \"default\"\n```\n\n## Skin Metadata \u0026 Color Sampling\n\n```ts\nimport { fetchSkinMetadata, computeSkinDominantColor } from \"minecraft-toolkit\";\n\nconst meta = await fetchSkinMetadata(\"26bz\", {\n  dominantColor: true,\n  sampleRegion: { x: 8, y: 8, width: 8, height: 8 },\n});\n\nconsole.log(meta.dominantColor); // e.g. \"#f2d2a9\"\n\nconst accent = await computeSkinDominantColor(meta.skin.url, {\n  x: 40,\n  y: 8,\n  width: 8,\n  height: 8,\n});\n```\n\n## Account Helpers\n\nA valid Microsoft/Xbox Live access token is required for `minecraftservices.com` endpoints. Missing or expired tokens throw `MinecraftToolkitError` with `statusCode: 401`.\n\n```ts\nimport {\n  fetchNameChangeInfo,\n  checkNameAvailability,\n  validateGiftCode,\n  fetchBlockedServers,\n} from \"minecraft-toolkit\";\n\nconst accessToken = process.env.MC_ACCESS_TOKEN;\n\nconst windowInfo = await fetchNameChangeInfo(accessToken);\nconst availability = await checkNameAvailability(\"fresh_name\", accessToken);\nconst isGiftValid = await validateGiftCode(\"ABCD-1234\", accessToken);\nconst blockedServer = await fetchBlockedServers(); // no token required\n```\n\n`validateGiftCode` returns `true`/`false` for 200/404 responses without throwing.\n\n## Server Status Helpers\n\nProbe Java and Bedrock servers without bringing your own RakNet/TCP logic.\n\n```ts\nimport {\n  fetchServerStatus,\n  fetchJavaServerStatus,\n  fetchBedrockServerStatus,\n} from \"minecraft-toolkit\";\n\nconst javaStatus = await fetchJavaServerStatus(\"mc.hypixel.net\", { port: 25565 });\nconst bedrockStatus = await fetchBedrockServerStatus(\"play.example.net\", { port: 19132 });\n\n// fetchServerStatus picks the right probe based on the `edition` field\nconst autoStatus = await fetchServerStatus(\"my.realm.net\", { edition: \"bedrock\" });\n\nconsole.log(javaStatus.players.online, bedrockStatus.motd);\n```\n\nBoth helpers normalize MOTD text, favicon/Base64 icons, latency, and version info. Errors surface as\n`MinecraftToolkitError` with contextual status codes.\n\n### Server Icon Helper\n\n```ts\nimport { fetchServerIcon } from \"minecraft-toolkit\";\n\nconst icon = await fetchServerIcon(\"play.example.net\");\nconsole.log(icon.base64); // \"iVBOR...\"\nconsole.log(icon.byteLength); // raw PNG size in bytes\n```\n\nThe helper reuses the Java status ping to extract the favicon, returning:\n\n- `dataUri`: ready-to-render `data:image/png;base64,...`\n- `base64`: raw Base64 payload\n- `buffer` + `byteLength` for further processing (e.g., resizing, hashing)\n\nIf the server doesn’t expose an icon, it throws `MinecraftToolkitError` (404).\n\n## Votifier Client (Java)\n\nSend vote notifications to classic Votifier v1 (RSA public key) and NuVotifier v2 (token/HMAC) servers without re-implementing either protocol.\n\n```ts\nimport { sendVotifierVote } from \"minecraft-toolkit\";\n\nconst result = await sendVotifierVote({\n  host: \"votifier.myserver.net\",\n  port: 8192, // defaults to 8192 if omitted\n  publicKey: process.env.VOTIFIER_PUBLIC_KEY, // v1 servers\n  serviceName: \"MyTopList\",\n  username: \"26bz\",\n  address: \"198.51.100.42\",\n  token: listingSiteConfig.token, // v2 servers (optional)\n  protocol: \"auto\", // let the handshake decide between v1/v2\n});\n\nconsole.log(result.acknowledged, result.version, result.protocol);\n```\n\n- Provide either a legacy RSA public key (for protocol v1) **or** a NuVotifier token (protocol v2). Server listing sites typically store each server's token and pass it here; `protocol: \"auto\"` will select the right flow based on the handshake.\n- `timestamp` accepts a `Date` or millisecond value (default: `Date.now()`). All failures bubble as `MinecraftToolkitError`.\n\n## Minecraft Formatting Renderer\n\nConvert legacy `§` or `\u0026` codes into safe HTML fragments or CSS class spans.\n\n```ts\nimport { toHTML, generateCSS, stripCodes, hasCodes, convertPrefix } from \"minecraft-toolkit\";\n\nconst motd = \"§aWelcome §lHeroes§r!\";\n\nconst inline = toHTML(motd); // \u003cspan style=\"color: #55ff55\"\u003eWelcome ...\u003c/span\u003e\n\nconst classes = toHTML(motd, { mode: \"class\", classPrefix: \"mc\" });\nconst css = generateCSS(); // drop into a \u003cstyle\u003e tag\n\nstripCodes(motd); // \"Welcome Heroes!\"\nhasCodes(motd); // true\nconvertPrefix(\"\u0026aHi\", \"toSection\"); // \"§aHi\"\n```\n\n`getMaps()` exposes the color and format metadata if you want to build custom renderers.\n\n## License\n\nPublished under the [MIT](https://github.com/26bz/minecraft-toolkit/blob/main/LICENSE) license.\nMade by [26bz](https://github.com/26bz)\n\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://github.com/26bz/minecraft-toolkit/graphs/contributors\"\u003e\n\u003cimg src=\"https://contrib.rocks/image?repo=26bz/minecraft-toolkit\" /\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F26bz%2Fminecraft-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F26bz%2Fminecraft-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F26bz%2Fminecraft-toolkit/lists"}