{"id":24291635,"url":"https://github.com/zardoy/mcraft-fun-mineflayer-plugin","last_synced_at":"2025-09-25T17:30:35.128Z","repository":{"id":268691215,"uuid":"900177327","full_name":"zardoy/mcraft-fun-mineflayer-plugin","owner":"zardoy","description":"Mineflayer plugin. Viewer connector for mcraft.fun (https://github.com/zardoy/prismarine-web-client/)","archived":false,"fork":false,"pushed_at":"2025-04-30T14:21:14.000Z","size":583,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T04:43:26.074Z","etag":null,"topics":["minecraft","mineflayer","mineflayer-viewer"],"latest_commit_sha":null,"homepage":"https://npmjs.com/mcraft-fun-mineflayer","language":"TypeScript","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/zardoy.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-12-08T04:14:44.000Z","updated_at":"2025-09-16T23:51:48.000Z","dependencies_parsed_at":"2024-12-18T10:41:59.489Z","dependency_job_id":"1b1f3aa6-5480-49dd-899c-79f3baa0ad4a","html_url":"https://github.com/zardoy/mcraft-fun-mineflayer-plugin","commit_stats":null,"previous_names":["zardoy/mcraft-fun-mineflayer-plugin"],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/zardoy/mcraft-fun-mineflayer-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zardoy%2Fmcraft-fun-mineflayer-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zardoy%2Fmcraft-fun-mineflayer-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zardoy%2Fmcraft-fun-mineflayer-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zardoy%2Fmcraft-fun-mineflayer-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zardoy","download_url":"https://codeload.github.com/zardoy/mcraft-fun-mineflayer-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zardoy%2Fmcraft-fun-mineflayer-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064308,"owners_count":25578999,"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-09-20T02:00:10.207Z","response_time":63,"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","mineflayer","mineflayer-viewer"],"created_at":"2025-01-16T14:56:17.467Z","updated_at":"2025-09-25T17:30:35.123Z","avatar_url":"https://github.com/zardoy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mineflayer Web Viewer\n\n![minecraft-web-viewer-chrome-mac](demo.webp)\n\nViewer for Vanilla clients \u0026 [mcraft.fun](https://mcraft.fun) ([repo](https://github.com/zardoy/minecraft-web-client)) project.\n\n## Features\n\n- Full \u0026 extended supported for the web client\n- Vanilla Minecraft clients support (tcp server is enabled by default)\n- Interactive UI controls (web client only)\n- Console output viewing \u0026 REPL (web client only)\n\n## Usage Example\n\n\u003e Note: there are known visual issues on 1.21.4\n\n```ts\nimport { createBot } from 'mineflayer'\nimport { viewerConnector, onReady } from 'mcraft-fun-mineflayer'\n\nconst bot = createBot({\n    host: 'your-server',\n    username: 'test',\n})\n\nbot.loadPlugin(viewerConnector({\n    // Enable console output viewing\n    sendConsole: true,\n    // Optional IP whitelist\n    // ipFilter: ['127.0.0.1'],\n    // Optionally enable remote JS code exection (use only with ip filter or password!)\n    // allowEval: true,\n    // forwardChat: true,\n\n    // Enable ssl so you can use it outside of your local network\n    // Note that it doesn't work on Windows without wsl currently (openssl is required)\n    ssl: {\n        enabled: true,\n        selfSigned: true,\n    },\n\n    // Optionally disable connection instructions\n    // showConnectionInstructions: false,\n}))\n\n// Add UI elements when plugin is ready\nonReady(bot).then(() =\u003e {\n    // Display bot state\n    bot.webViewer.ui.updateUI('status', {\n        type: 'text',\n        x: 10,\n        y: 10,\n        text: 'Waiting for new objective...', // pixelart icons are supported eg {icon:eye}\n    })\n\n    // Add interactive controls\n    bot.webViewer.ui.updateLil('controls', {\n        forward: false,\n        backwards: false,\n        left: false,\n        right: false,\n        sneak: false,\n        async jump() {\n            await bot.setControlState('jump', true)\n            setTimeout(() =\u003e bot.setControlState('jump', false), 100)\n        }\n    }, {\n        // Optional callback when values change\n        onUpdate(id, newValue) {\n            if (id === 'forward') {\n                bot.setControlState('forward', newValue)\n            } else if (id === 'backwards') {\n                bot.setControlState('back', newValue)\n            } else if (id === 'left') {\n                bot.setControlState('left', newValue)\n            } else if (id === 'right') {\n                bot.setControlState('right', newValue)\n            } else if (id === 'sneak') {\n                bot.setControlState('sneak', newValue)\n            }\n        }\n    })\n})\n\nsetTimeout(() =\u003e {\n    bot.webViewer.ui.updateText('status', 'New objective found!')\n}, 5000)\n```\n\nLook at [example/tester.ts](example/tester.ts) for a more complete example!\n\n## Key Options\n\n- `websocketPort` (default: 25588) - WebSocket server port\n- `tcpPort` (default: 25587) - TCP server port for vanilla clients\n- `ipFilter` - Array of allowed IP addresses\n- `sendConsole` (default: false) - Enable console output in viewer\n- `showConnectionInstructions` (default: true) - Show connection URLs in console\n- `password` - Requires web client to connect with password, disables vanilla clients\n\n## Using Headless\n\nWe don't provide built-in headless web client functionality, but you can use Puppeteer or similar browser automation tools to capture screenshots or video streams from the web viewer interface.\n\nSee [example/headless.js](example/headless.js) for an example of how to use Puppeteer to capture a video stream from the web viewer!\n\n## Roadmap\n\n- [ ] (high priority) Public relay server\n- [ ] Support for takeover mode\n- [ ] Fix connectivity issues for vanilla clients 1.21\n- [ ] Refactor core packets relay functionality \u0026 server to a dedicated package, cleanup\n- [X] Custom UI like images, svgs, circles... (done, you can specify your own css for text)\n- [ ] Add support for forwarding resource packs (easy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzardoy%2Fmcraft-fun-mineflayer-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzardoy%2Fmcraft-fun-mineflayer-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzardoy%2Fmcraft-fun-mineflayer-plugin/lists"}