Giter Club home page Giter Club logo

minecraft.sh's Introduction

minecraft.sh

logo

A minecraft client/bot library written in pure bash + coreutils

github

Why?

I wanted to learn more about bash, maintaining libraries, and the minecraft protocol. This is mostly a learning excersize on my end. If you were looking for an actual featured bot library, there are probably better options.

Features

Feature Supported?
1.20.1
Mining
Placing Blocks
Entities
Chat
Metadata Retrival
Movement
Inventory Management
Chunk/Biome data
Pathfinding
Vehicles
Chat encryption
Online-Mode support
Old protocol versions

Cool demos

Chat client (see examples/chatclient.sh)

chatclient.mp4

Auto-stripminer (see examples/stripminer.sh)

stripminer.mp4

How to use

minecraft.sh provides a simple high level library API for creating bots that can be easily used in any shell script. For example, here's a simple bot that will automatically "strip mine" in a straight line

source src/minecraft.sh
source examples/demohooks.sh
DELAY=0.25
start_login

sleep 4
while true; do
  wait_on_login
  m_get_player_pos
  for i in {0..2}; do
    for j in {0..1}; do
      m_mine_relative "$i" "$j" 0 "$DELAY"
      m_mine_relative "$i" "$j" 0 "$DELAY"
    done
  done
  for i in {0..4}; do
    m_move_relative 1 0 0
    sleep 0.1
  done
  for i in {1..3}; do
    m_mine_relative -1 1 "$i" "$DELAY"
    m_mine_relative -1 1 "$i" "$DELAY"
  done
  for i in {1..3}; do
    m_mine_relative -1 1 "-$i" "$DELAY"
    m_mine_relative -1 1 "-$i" "$DELAY"
  done
  sleep 0.1
done

More examples can be found here, and make sure to check out the documentation

Note: ksh is recommended for running any of the examples

Dependencies

The only non-coreutil dependencies are zlib-flate and xxd. zlib-flate is optional if compression is disabled in server.properties, and if you swap out util.sh with util-pure.sh xxd is optional too.

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.