Merge branch 'kolbytn:main' into main

This commit is contained in:
Lawtro37 2024-10-30 19:22:59 +10:00 committed by GitHub
commit d524999daf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 30 additions and 21 deletions

View file

@ -10,7 +10,7 @@ This project allows an AI model to write/execute code on your computer that may
## Requirements
- [Minecraft Java Edition](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc) (up to v1.20.4)
- [Minecraft Java Edition](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc) (up to v1.21.1)
- [Node.js](https://nodejs.org/) (at least v14)
- One of these: [OpenAI API Key](https://openai.com/blog/openai-api) | [Gemini API Key](https://aistudio.google.com/app/apikey) |[Anthropic API Key](https://docs.anthropic.com/claude/docs/getting-access-to-claude) | [Replicate API Key](https://replicate.com/) | [Hugging Face API Key](https://huggingface.co/) | [Groq API Key](https://console.groq.com/keys) | [Ollama Installed](https://ollama.com/download)
@ -34,7 +34,7 @@ Then, clone/download this repository
Run `npm install` from the installed directory
Install the minecraft version specified in `settings.js`, currently supports up to 1.20.4
Install the minecraft version specified in `settings.js`, currently supports up to 1.21.1
### Running Locally

View file

@ -11,6 +11,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": true,
"self_defense": true,
"hunting": true,

View file

@ -6,8 +6,8 @@
"@huggingface/inference": "^2.8.1",
"google-translate-api-x": "^10.7.1",
"groq-sdk": "^0.5.0",
"minecraft-data": "^3.46.2",
"mineflayer": "^4.20.0",
"minecraft-data": "^3.78.0",
"mineflayer": "^4.23.0",
"mineflayer-armor-manager": "^2.0.1",
"mineflayer-auto-eat": "^3.3.6",
"mineflayer-collectblock": "^1.4.1",
@ -15,7 +15,7 @@
"mineflayer-pvp": "^1.3.2",
"openai": "^4.4.0",
"patch-package": "^8.0.0",
"prismarine-item": "^1.14.0",
"prismarine-item": "^1.15.0",
"prismarine-viewer": "^1.28.0",
"replicate": "^0.29.4",
"vec3": "^0.1.10",

View file

@ -1,17 +1,16 @@
diff --git a/node_modules/mineflayer-pathfinder/index.js b/node_modules/mineflayer-pathfinder/index.js
index b38bd30..cfaa677 100644
index b38bd30..bf16a63 100644
--- a/node_modules/mineflayer-pathfinder/index.js
+++ b/node_modules/mineflayer-pathfinder/index.js
@@ -541,7 +541,7 @@ function inject (bot) {
let canPlace = true
if (placingBlock.jump) {
bot.setControlState('jump', true)
- canPlace = placingBlock.y + 1 < bot.entity.position.y
+ canPlace = placingBlock.y + 1.8 < bot.entity.position.y
}
if (canPlace) {
if (!lockEquipItem.tryAcquire()) return
@@ -557,6 +557,7 @@ function inject (bot) {
@@ -550,6 +550,7 @@ function inject (bot) {
lockEquipItem.release()
const refBlock = bot.blockAt(new Vec3(placingBlock.x, placingBlock.y, placingBlock.z), false)
if (!lockPlaceBlock.tryAcquire()) return
+ bot.world.setBlockStateId(refBlock.position.offset(placingBlock.dx, placingBlock.dy, placingBlock.dz), 1)
if (interactableBlocks.includes(refBlock.name)) {
bot.setControlState('sneak', true)
}
@@ -557,6 +558,7 @@ function inject (bot) {
.then(function () {
// Dont release Sneak if the block placement was not successful
bot.setControlState('sneak', false)

View file

@ -13,6 +13,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": true,
"self_defense": true,
"hunting": true,

View file

@ -16,6 +16,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": true,

View file

@ -13,6 +13,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": true,
"self_defense": true,
"hunting": true,

View file

@ -13,6 +13,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": true,

View file

@ -11,6 +11,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": true,

View file

@ -15,6 +15,7 @@
"modes": {
"self_preservation": true,
"unstuck": true,
"cowardice": false,
"self_defense": true,
"hunting": true,

View file

@ -1,15 +1,18 @@
export default
{
"minecraft_version": "1.20.4", // supports up to 1.20.4
"minecraft_version": "1.20.4", // supports up to 1.21.1
"host": "127.0.0.1", // or "localhost", "your.ip.address.here"
"port": 55916,
"auth": "offline", // or "microsoft"
"profiles": [
"./andy.json",
// add more profiles here, check ./profiles/ for more
// more than 1 profile will require you to /msg each bot indivually
// "./profiles/gpt.json",
// "./profiles/claude.json",
// "./profiles/gemini.json",
// "./profiles/llama.json",
// using more than 1 profile requires you to /msg each bot indivually
],
"load_memory": false, // load memory from previous session
"init_message": "Say hello world and your name", // sends to all on spawn

View file

@ -14,7 +14,7 @@ export function getCommand(name) {
return commandMap[name];
}
const commandRegex = /!(\w+)(?:\(((?:[^)(]+|'[^']*'|"[^"]*")*)\))?/
const commandRegex = /!(\w+)(?:\(([\s\S]*)\))?/
const argRegex = /(?:"[^"]*"|'[^']*'|[^,])+/g;
export function containsCommand(message) {