710.00 b

Description: In minecraft, this code can implement text->behavior(minecraft).

#700#Research_Paper#710#methodology#710.00#Multi-agent_Reinforcement_Learning#710.00 b#Mindcraft
#mindcraft #minecraft

Audience

Who wants to apply AI in minecraft to implement text to behavior

Features

text -> behavior
using llm , easy to use
code https://github.com/kolbytn/mindcraft

allowinsecure <- attribute
using this option new prompt order can be executed. when npc get new behavior, write code itself and do it.

Usage

after you download, public chatting npc.
if you want to whisper to npc, add this code

src/agent/agent.js

            this.bot.on('whisper', (username, message) => {
                this.processMessage(username, message);
            });

            // set the bot to automatically eat food when hungry
            this.bot.autoEat.options = {
                priority: 'foodPoints',
                startAt: 14,
                bannedFood: ["rotten_flesh", "spider_eye", "poisonous_potato", "pufferfish", "chicken"]
            };

            if (init_message) {
                this.handleMessage('system', init_message);
            } else {
                this.bot.chat('Hello world! I am ' + this.name);
                this.bot.emit('finished_executing');
            }

            this.startEvents();
        });
    }

    processMessage(username, message) {
        if (username === this.name) return;
        
        const ignore_messages = [
            "Set own game mode to", "Set the time to", "Set the difficulty to",
            "Teleported ", "Set the weather to", "Gamerule "
        ];
        if (ignore_messages.some(m => message.startsWith(m))) return;

        console.log('Received message from', username, ':', message);
        this.handleMessage(username, message);
    }

allowinsecure coding

This warning is highlighting a significant security concern related to the project you are working on, which involves an AI model having the capability to write and execute code on your computer. Here's a breakdown of what it means:

- **AI Model Writing/Executing Code**: Your project has the functionality to let an AI model (like GPT or another model) generate and run code based on its interactions or tasks within a Minecraft server. This can include actions like building structures automatically, navigating the world, or responding to player inputs.
    
- **Insecure, Dangerous, and Vulnerable to Injection Attacks**: Allowing an AI to write and execute code opens up potential risks, especially if the code generation is not strictly controlled or sanitized. Malicious users could exploit this feature to execute harmful code on your server or even on your computer, leading to security breaches. This is particularly risky on public servers where many players can interact with the AI.
    
- **Code Writing Disabled by Default**: To mitigate these risks, the feature that allows AI to write and execute code is turned off by default. This means you must explicitly enable it if you want to use this functionality.
    
- **Enabling Insecure Coding**: You can enable AI code writing and execution by setting `"allow_insecure_coding": true` in the `settings.json` file. However, this should only be done if you understand and accept the risks involved.
    
- **Use Only on Local or Private Servers**: The warning advises that you should only enable this feature on local or private servers where you have control over who can access and what can be executed. Public servers, where many users can join without strict controls, pose a much higher risk for malicious activities.
    

In summary, this warning is there to make you aware of the security implications of enabling AI to write and execute code in your project. It recommends precautions to ensure that if you decide to use this powerful feature, you do so in a controlled and safe environment to prevent potential security vulnerabilities.


allowinsecure coding

This warning is highlighting a significant security concern related to the project you are working on, which involves an AI model having the capability to write and execute code on your computer. Here's a breakdown of what it means:

- **AI Model Writing/Executing Code**: Your project has the functionality to let an AI model (like GPT or another model) generate and run code based on its interactions or tasks within a Minecraft server. This can include actions like building structures automatically, navigating the world, or responding to player inputs.
    
- **Insecure, Dangerous, and Vulnerable to Injection Attacks**: Allowing an AI to write and execute code opens up potential risks, especially if the code generation is not strictly controlled or sanitized. Malicious users could exploit this feature to execute harmful code on your server or even on your computer, leading to security breaches. This is particularly risky on public servers where many players can interact with the AI.
    
- **Code Writing Disabled by Default**: To mitigate these risks, the feature that allows AI to write and execute code is turned off by default. This means you must explicitly enable it if you want to use this functionality.
    
- **Enabling Insecure Coding**: You can enable AI code writing and execution by setting `"allow_insecure_coding": true` in the `settings.json` file. However, this should only be done if you understand and accept the risks involved.
    
- **Use Only on Local or Private Servers**: The warning advises that you should only enable this feature on local or private servers where you have control over who can access and what can be executed. Public servers, where many users can join without strict controls, pose a much higher risk for malicious activities.
    

In summary, this warning is there to make you aware of the security implications of enabling AI to write and execute code in your project. It recommends precautions to ensure that if you decide to use this powerful feature, you do so in a controlled and safe environment to prevent potential security vulnerabilities.