{"id":20898651,"url":"https://github.com/leonardosnt/mc-player-counter","last_synced_at":"2025-05-13T01:31:10.776Z","repository":{"id":48017554,"uuid":"91183388","full_name":"leonardosnt/mc-player-counter","owner":"leonardosnt","description":"Displays the number of online players in your Minecraft Server on your website using 2 lines of HTML.","archived":false,"fork":false,"pushed_at":"2023-01-12T06:49:09.000Z","size":121,"stargazers_count":84,"open_issues_count":17,"forks_count":25,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-14T11:01:32.179Z","etag":null,"topics":["counter","html","javascript","minecraft","player"],"latest_commit_sha":null,"homepage":"https://leonardosnt.github.io/mc-player-counter/examples/","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/leonardosnt.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":"2017-05-13T15:21:43.000Z","updated_at":"2024-03-26T07:10:32.000Z","dependencies_parsed_at":"2023-02-09T10:31:57.051Z","dependency_job_id":null,"html_url":"https://github.com/leonardosnt/mc-player-counter","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardosnt%2Fmc-player-counter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardosnt%2Fmc-player-counter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardosnt%2Fmc-player-counter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardosnt%2Fmc-player-counter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonardosnt","download_url":"https://codeload.github.com/leonardosnt/mc-player-counter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225165669,"owners_count":17431341,"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":["counter","html","javascript","minecraft","player"],"created_at":"2024-11-18T11:11:35.734Z","updated_at":"2024-11-18T11:11:36.430Z","avatar_url":"https://github.com/leonardosnt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mc-player-counter\n\nDisplays the number of online players in your Minecraft Server on your website using 2 lines of HTML.\n\nThe only two lines needed are the script tag and the element that will display the number. Example:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/leonardosnt/mc-player-counter/dist/mc-player-counter.min.js\"\u003e\u003c/script\u003e\n\nThere are \u003cspan data-playercounter-ip=\"mc.hypixel.net\"\u003e0\u003c/span\u003e players on Hypixel right now.\n```\n\n## Options\n  - refreshRate - The rate that the counter will refresh (1m by default. Note that https://mcapi.us/ has a 5 minute cache.)\n  - format - Format that the counter will be displayed\n    - `{max}` - Maximum players\n    - `{online}` - Online players\n  - ip - Server IP. E.g (`mc.hypixel.net`), with port (`mc.hypixel.net:25565`)\n  - element - Element that the counter will be rendered in.\n\nIn HTML, the attributes should be prefixed with `data-playercounter-`. E.g (`data-playercounter-ip`)\n\nIt's also possible to display the server status by adding the attribute `data-playercounter-status`. It will display \"online\" or \"offline\".\nSee [example](examples/index.html#L12)\n\n## Demo\n- https://leonardosnt.github.io/mc-player-counter/examples/ ([Source](https://github.com/leonardosnt/mc-player-counter/blob/master/examples/index.html#L10-L12))\n\n## Example (including HTML template):\n\nHTML\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- ... --\u003e\n    \u003cscript src=\"https://cdn.jsdelivr.net/gh/leonardosnt/mc-player-counter/dist/mc-player-counter.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    There are \u003cspan data-playercounter-ip=\"my.server.ip\"\u003e0\u003c/span\u003e players online on my server.\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nJS (\"API\")\n```javascript\nnew PlayerCounter({\n  element: element,\n  ip: 'server ip',\n  format: '{online}/{max}' // default {online}\n  refreshRate: 60 * 1000 // default 1m\n});\n```\n\n## License\n\nCopyright (C) 2017-2020 leonardosnt \u003cleonrdsnt@gmail.com\u003e  \nLicensed under the MIT License. See LICENSE file in the project root for full license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardosnt%2Fmc-player-counter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonardosnt%2Fmc-player-counter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardosnt%2Fmc-player-counter/lists"}