{"_id":"@aidentran900/prismarine-viewer","name":"@aidentran900/prismarine-viewer","dist-tags":{"latest":"1.33.0"},"versions":{"1.33.0":{"name":"@aidentran900/prismarine-viewer","version":"1.33.0","description":"Web based viewer","main":"index.js","scripts":{"jestTest":"jest --verbose --runInBand --forceExit","test":"npm run test","pretest":"npm run lint","lint":"standard","prepare":"node viewer/prerender.js","fix":"standard --fix"},"author":{"name":"PrismarineJS"},"license":"MIT","standard":{"ignore":["examples/electron/","examples/exporter/","examples/standalone/","examples/web_client/"]},"dependencies":{"@tweenjs/tween.js":"^23.1.1","compression":"^1.7.4","express":"^4.17.1","minecraft-data":"^3.0.0","prismarine-block":"^1.7.3","prismarine-chunk":"^1.22.0","prismarine-world":"^3.3.1","socket.io":"^4.0.0","socket.io-client":"^4.0.0","three":"0.128.0","three.meshline":"^1.3.0","vec3":"^0.1.7"},"devDependencies":{"assert":"^2.0.0","buffer":"^6.0.3","canvas":"^3.1.0","fs-extra":"^11.0.0","jest":"^29.7.0","jest-puppeteer":"^11.0.0","minecraft-assets":"^1.9.0","minecraft-wrap":"^1.3.0","minecrafthawkeye":"^1.2.5","mineflayer":"^4.0.0","mineflayer-pathfinder":"^2.0.0","node-canvas-webgl":"github:PrismarineJS/node-canvas-webgl","prismarine-schematic":"^1.2.0","prismarine-viewer":"file:./","process":"^0.11.10","puppeteer":"^22.8.2","standard":"^17.1.0","webpack":"^5.10.2","webpack-cli":"^6.0.1"},"_id":"@aidentran900/prismarine-viewer@1.33.0","gitHead":"756bdb846e6ede9d607563067e134d32475bd024","types":"./index.d.ts","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-E5UKsZN12huDn8WT57IIct/pQmd6KTp2mGJOVnj7UvVWVd2b1UR3o8AizxQ/WjfFTE47skROzkLGcShY1qb0EA==","shasum":"2889b9a24fee83dd0a59646b505da4d50b03553e","tarball":"https://registry.npmjs.org/@aidentran900/prismarine-viewer/-/prismarine-viewer-1.33.0.tgz","fileCount":32568,"unpackedSize":309435515,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCWfR6b0QVqAKXzo9lUn2HW2N5mKeUndpdN4LFW3xwJqwIhAI37QDl9XByhntZgrTi9HcwiFrWJxDU0wSgNdeFpZq74"}]},"_npmUser":{"name":"aidentran900","email":"aidentran900@gmail.com"},"directories":{},"maintainers":[{"name":"aidentran900","email":"aidentran900@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prismarine-viewer_1.33.0_1780013147526_0.3623630552782948"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T00:05:47.232Z","1.33.0":"2026-05-29T00:05:48.257Z","modified":"2026-05-29T00:05:48.592Z"},"maintainers":[{"name":"aidentran900","email":"aidentran900@gmail.com"}],"description":"Web based viewer","author":{"name":"PrismarineJS"},"license":"MIT","readme":"# prismarine-viewer\n\nWeb based viewer for servers and bots\n\n[![NPM version](https://img.shields.io/npm/v/prismarine-viewer.svg)](http://npmjs.com/package/prismarine-viewer)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/PrismarineJS/prismarine-viewer/ci.yml.svg?label=CI&logo=github&logoColor=lightgrey)](https://github.com/PrismarineJS/prismarine-viewer/actions?query=workflow%3A%22CI%22)\n[![Discord](https://img.shields.io/badge/chat-on%20discord-brightgreen.svg)](https://discord.gg/GsEFRM8)\n[![Gitter](https://img.shields.io/badge/chat-on%20gitter-brightgreen.svg)](https://gitter.im/PrismarineJS/general)\n[![Irc](https://img.shields.io/badge/chat-on%20irc-brightgreen.svg)](https://irc.gitter.im/)\n[![Issue Hunt](https://github.com/BoostIO/issuehunt-materials/blob/master/v1/issuehunt-shield-v1.svg)](https://issuehunt.io/r/PrismarineJS/prismarine-viewer)\n\n[![Try it on gitpod](https://img.shields.io/badge/try-on%20gitpod-brightgreen.svg)](https://gitpod.io/#https://github.com/PrismarineJS/prismarine-viewer)\n\n[<img src=\"https://prismarinejs.github.io/prismarine-viewer/test_1.18.1.png\" alt=\"viewer\" width=\"300\">](https://prismarinejs.github.io/prismarine-viewer/)\n\nSupports versions 1.8.8, 1.9.4, 1.10.2, 1.11.2, 1.12.2, 1.13.2, 1.14.4, 1.15.2, 1.16.1, 1.16.4, 1.17.1, 1.18.1, 1.19, 1.20.1, 1.21.1, 1.21.4.\n\n## Install\n\n```bash\nnpm install prismarine-viewer\n```\n\n## Example\n\n```js\nconst mineflayer = require('mineflayer')\nconst mineflayerViewer = require('prismarine-viewer').mineflayer\n\nconst bot = mineflayer.createBot({\n  username: 'Bot'\n})\n\nbot.once('spawn', () => {\n  mineflayerViewer(bot, { port: 3000 }) // Start the viewing server on port 3000\n\n  // Draw the path followed by the bot\n  const path = [bot.entity.position.clone()]\n  bot.on('move', () => {\n    if (path[path.length - 1].distanceTo(bot.entity.position) > 1) {\n      path.push(bot.entity.position.clone())\n      bot.viewer.drawLine('path', path)\n    }\n  })\n})\n```\n\nMore examples:\n\n* First person bot [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/firstperson_bot.js)\n* Record view as video file [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/headless.js)\n* Streaming video to a python script [example](https://github.com/PrismarineJS/prismarine-viewer/tree/master/examples/python)\n* Visualize a world, without a bot [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/standalone.js)\n* Visualize the world coming from a proxy [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/proxy.js)\n* Click to move [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/clickmove.js)\n* Use the core api for viewing worlds [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/core)\n* Create an electron app with viewer [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/electron)\n* Create a fully front end viewer with an in memory world [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/standalone)\n* A minecraft web client example, using mineflayer and a websocket proxy [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/web_client)\n* Export parts of worlds as screenshot or 3d models [example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/exporter)\n\n## Projects using prismarine-viewer\n\n* [prismarine-web-client](https://gitlab.com/PrismarineJS/prismarine-web-client) A minecraft client in your browser\n\n\n## API\n\n### prismarine-viewer\n\n#### viewer\n\nThe core rendering library. It provides Viewer and WorldView which together make it possible to render a minecraft world.\nCheck its [API](viewer/README.md)\n\n#### mineflayer\n\nServe a webserver allowing to visualize the bot surrounding, in first or third person. Comes with drawing functionnalities.\n\n```js\nconst { mineflayer } = require('prismarine-viewer')\n```\n\nOptions:\n* `viewDistance` view radius, in chunks, default: `6`\n* `firstPerson` is the view first person ? default: `false`\n* `port` the port for the webserver, default: `3000`\n\n[example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/bot.js)\n\n#### standalone\n\nServe a webserver allowing to visualize a world.\n\n```js\nconst { standalone } = require('prismarine-viewer')\n```\n\nOptions:\n* `version` the version to use, default: `1.13.2`\n* `generator` a world generator function, default: `(x, y, z) => 0`\n* `center` a vec3 to center the view on, default: `new Vec3(0, 0, 0)`\n* `viewDistance` view radius, in chunks, default: `6`\n* `port` the port for the webserver, default: `3000`\n\n[example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/standalone.js)\n\n#### headless\n\nRender the bot view and stream it to a file or over TCP.\n\n```js\nconst { headless } = require('prismarine-viewer')\n```\n\nOptions:\n* `viewDistance` view radius, in chunks, default: `6`\n* `output` the output file or a `host:port` address to stream to, default: `output.mp4`\n* `frames` number of frames to record, `-1` for infinite, default: `200`\n* `width` the width of a frame, default: `512`\n* `height` the height of a frame, default: `512`\n\n[example](https://github.com/PrismarineJS/prismarine-viewer/blob/master/examples/headless.js)\n\n### Drawing (mineflayer mode)\n\nAll drawing function have a unique id that can be used to replace or erase the primitive.\n\n#### bot.viewer.drawLine (id, points, color=0xff0000)\n\nDraw a line passing through all the `points`.\n\n#### bot.viewer.erase (id)\n\nRemove the primitive with the given id from the display.\n\n#### bot.viewer.close ()\n\nStop the server and disconnect users.\n\n## Tests\n\n`npm run jestTest -- -t \"1.9.4\"`\n","readmeFilename":"README.md","_rev":"1-b95690359e2fe72380b5076a4ede43fe"}