Giter Club home page Giter Club logo

mc-bingo-bot's Introduction

mc-bingo-bot

mc-bingo-bot is a mineflayer - based bot that is able to play minecraft map called bingo.

The project is not done yet, but you can still install and use it however you want.

Installation

git clone https://github.com/Syriusz-2005/mc-bingo-bot
cd mc-bingo-bot
npm install

Usage

npm run start name=<bot_name> host=<server> version=<mc_version>

After the bot joined you can use one of the following commands on the chat:

!hello
!analyze
!getItem <block_name> [count]
!restart
!winBingo

Block types

Command !getItem works only for block types specified in:

bingo/goals.json

You can add your own blocks into goals.json using this schema:

{
  "config": {
    //an array of items that bot will optain first after typing !winBingo
    "itemsBotNeeds": [
      { "name": "<item_name>", "count" : 1 }
    ]
  },
  "items": {

    "<your_item_name>": {
      "conditions": [
        
        {
          "type": "<condition_type>",
          "name": "<condition_main_param>",

          //and optional values
          "recursive": false, //should item specified in "name" be found recursively
          "action_after_resolved": "[action_after_condition]",
          "resultsIn": 1
        }

        //here you can add as many conditions as you want
        //If any condition is resolved, next conditions won't be checked

      ]
    }

  }
}

Available conditions

  • inInventory - Checks if the <condition_main_param> is in bot inventory.
  • itemOnGround - Checks if the <condition_main_param> is on ground nearby and goes to it's position.
  • blockNearby - Checks if there's a <condition_main_param> block nearby and mines it.
  • entityNearby - Checks if the <condition_main_param> entity is nearby and tries to kill the entity.

Available actions

  • craft - Tries to craft the <your_item_name>. For this action, <condition_main_param> param should be a list of items that bot needs to craft <your_item_name>

    • "name": [
          {
            "requiredItem": "item_1",
            "requiredCount": 6
          },
      
          ...
        ]
  • recheckConditions - force checks all conditions after 500 ms

    • When should be used? with condtion blockNearby - Item after breaking drops after some time, not in the same moment. You should use blockNearby with recheckConditions action to pickup dropped item!
  • smell - Similar to craft except it does not need special <condition_main_param> attribute only item name that should be smelt.

Oder attributes

  • recursive - Checks recursively for the needed item. Can create infinite loops when used uncorrectly Used mostly when one item requires another to be crafted or smelted because if the bot doesn't have needed item in inventory, he can recursively find it.
  • count - Used only in smell action where it means, that one item will give 1 smelted item.
  • resultsIn - Used only in craft action where it means that crafting this item will result in exactly resultsIn items per craft.

Complete Example

In this example we can see more item names then only golden_apple for example:

  • apple
  • gold_ingot

Those items should be also specified, because bot doesn't know how to get them.

  "golden_apple":{
    "madeBy": "mikib",
    "conditions":[
      
      {
        "type":"inInventory",
        "name":"golden_apple"
      },

      {
        "type":"itemOnGround",
        "name": "golden_apple"
      },

      {
        "type": "inInventory",
        "name": [
          {
            "requiredItem":"apple",
            "requiredCount":1
          },
          {
            "requiredItem":"gold_ingot",
            "requiredCount":8
          }
        ],
        "resultsIn": 1,
        "recursive": true,
        "actionAfterResolved": "craft"  
        
      }
    ]
  }

mc-bingo-bot's People

Contributors

syriusz-2005 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.