kolbytn / mindcraft

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello i have a error i trying to run main.json.

mrrat1337 opened this issue · comments

and the code says to put openai api key but i want ollama 3. how to do?

C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main>node main.js
Using chat settings: { model: 'llama3', api: 'ollama' }
Using embedding settings: { api: 'none' }
Unknown embedding: none . Using word overlap.
Loading examples...
Examples loaded.
Logging in...
C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:108
const version = require('minecraft-data')(bot._client.version).version
^

TypeError: Cannot read properties of null (reading 'version')
at next (C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:108:67)
at createBot (C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:105:34)
at initBot (file:///C:/Users/Razvan/Downloads/mindcraft-main%20(1)/mindcraft-main/src/utils/mcdata.js:51:15)
at Agent.start (file:///C:/Users/Razvan/Downloads/mindcraft-main%20(1)/mindcraft-main/src/agent/agent.js:24:20)

Hi Razvan!
Firstly ,you should run this command “node main.js” not “main.json”.
Secondly, have you made sure you installed all the prerequisites? Have you started the game and opened it to LAN on the same port as set in the settings file?
To use llama, you need some prerequisites installed. Also in andy.json under model you should have the model name “llama3”.
Make sure you started the llama model before you start “mindcraft”.
Make sure your game version is 1.20.4 not higher.
I also don t recommend llama3 because it is laggy and it crashes a lot.

C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main>node main.js
Using chat settings: { model: 'llama3', api: 'ollama' }
Using embedding settings: { api: 'none' }
Unknown embedding: none . Using word overlap.
Loading examples...
Examples loaded.
Logging in...
C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:108
const version = require('minecraft-data')(bot._client.version).version
^

TypeError: Cannot read properties of null (reading 'version')
at next (C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:108:67)
at createBot (C:\Users\Razvan\Downloads\mindcraft-main (1)\mindcraft-main\node_modules\mineflayer\lib\loader.js:105:34)
at initBot (file:///C:/Users/Razvan/Downloads/mindcraft-main%20(1)/mindcraft-main/src/utils/mcdata.js:51:15)
at Agent.start (file:///C:/Users/Razvan/Downloads/mindcraft-main%20(1)/mindcraft-main/src/agent/agent.js:24:20)

Node.js v20.14.0
Agent process exited with code 1 and signal null
Agent process exited too quickly. Killing entire process. Goodbye.

i made to connect but how to make it to build something?

Steps to run with Llama3 model:

  1. make sure Andy.json has the following structure:
    ` {
    "name": "andy",

"model": "llama3",

"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, .........."
.... etc
}`

  1. Run llama3 from a command prompt. Open a cmd window and run this command: ollama run llama3
  2. Run the game and open to LAN to specified LAN port.
  3. Open a new cmd window. CD into this repository's downloaded folder. Run node main.js
  4. type commands in the game for the model to execute them :

image

To make it build stuff on his own, you could edit the settings file : allow_insecure_coding: true