| ?英語 | ?俄語 | ?葡萄牙語 |
|---|
在網頁中運行的Minecraft客戶端。 https://prismarinejs.github.io/prismarine-web-client/實時演示
Prismarine-web-client在瀏覽器中運行MineFlayer和Prismarine-ciewer,該瀏覽器將Websocket連接到代理,該代理將Websocket連接轉換為TCP,以連接到普通的Minecraft服務器。 Prismarine-Web-Client基於:
檢查這些模塊,您是否想了解更多它的工作原理並做出貢獻!

單擊此鏈接以在您的瀏覽器中打開它,無需安裝:https://prismarinejs.github.io/prismarine-web-client/
在Chrome&Firefox上測試台式機平台。
要自己託管,請在bash中運行這些命令:
$ npm install -g prismarine-web-client
$ prismarine-web-client最後,在瀏覽器中打開http://localhost:8080 。
如果您要進行貢獻/進行更改,則需要以不同的方式安裝它。
首先,克隆回購。
然後,將您的工作目錄設置為存儲庫。例如:
$ cd ~ /prismarine-web-client/最後,運行
$ npm install
$ npm start這將在開發模式下啟動Express和WebPack;每當您保存文件時,構建將重做(需要5s),您可以刷新頁面以獲取新的結果。
連接到http:// localhost:8080在瀏覽器中。
您可能需要在IDE中禁用自動節省,以避免不斷重建;請參閱https://webpack.js.org/guides/development/#adjusting-your-text-editor。
要檢查生產構建(將需要一分鐘的構建),您可以運行npm run build-start 。
如果您有興趣貢獻,可以在https://github.com/prismarinejs/prismarine-web-client/projects上查看項目。
一些變量在全局window對像中暴露以進行調試:
botviewermcDataworldViewVec3pathfinderdebugMenudebugmenu.customentries ['mykey'] ='myValue'刪除debugmenu.customentries ['mykey']
在Chrome Devtools中:
bot.chat('test')允許您使用聊天bot.chat(JSON.stringify(Object.values(bot.players).map(({username, ping}) => ({username, ping}))))window.bot.entity.position.y += 5跳bot.chat(JSON.stringify(bot.findBlock({matching:(block) => block.name==='diamond_ore', maxDistance:256}).position))找到鑽石塊的位置bot.physics.stepHeight = 2允許您行走bot.physics.sprintSpeed = 5更快的步行=bot.loadPlugin(pathfinder.pathfinder)然後bot.pathfinder.goto(new pathfinder.goals.GoalXZ(100, 100))轉到位置100,100有關更多調試想法,請閱讀MineFlayer Doc。