Giter Club home page Giter Club logo

minecraftbot's Introduction

MinecraftBOT

Description

Minecraft bot. Currently, used for afk on a Survival Server 😅

Features

  • Graphical User Interface
  • LogPanel to see errors directly
  • Tested with Spigot, Paper 1.18.2
  • Disconnects gracefully after the end
  • Free
  • Open source
  • Command Line Interface
  • Online (Microsoft)
  • Cracked
  • Automatic Respawn
  • Auto Reconnect with Delay (Only if DisconnectEvent is throw, and the reason is not Disconnected)
  • Support for Minecraft translations
  • Run command when the bot is connected

Todos

  • Multi Version
  • Forge Support
  • Fabric Support
  • Proxies Support
  • Account Saving (Refresh Token)
  • Refactor the whole code
  • More options

Requirements

  • Java 8+
  • Minecraft Server 1.18.2

Downloads

https://github.com/alwyn974/MinecraftBOT/releases

Images

Gui

For cracked account, just type the username in Email field

Tips

There are environment variable to override the default value of host, port, username and password

  • MC_BOT_HOST for the host (String)
  • MC_BOT_PORT for the port (Integer)
  • MC_BOT_USERNAME for the email/username (String)
  • MC_BOT_PREMIUM to specify if the Microsoft Authentication should be used (Boolean)
  • MC_BOT_DEBUG for the debug mode (Boolean)
  • MC_BOT_PREFIX for the prefix of the commands (default=.) (String)
  • MC_BOT_AUTO_RECONNECT for the auto reconnect mode (Boolean)
  • MC_BOT_RECONNECT_DELAY for the delay before reconnect (Integer)
  • MC_BOT_LANG_FILE for the language file (default=en_us.json) (String) (File must be in the lang directory at the same level as the jar file)
  • MC_BOT_COMMAND for the command to execute when the bot is connected (String) (Example: /say Hello World!)
  • MC_BOT_COMMAND_DELAY for the delay before executing the command (default=750ms) (Integer)

They are some builtin commands in the bot

  • difficulty get the difficulty of the server
  • food get the food level of the player
  • help get all the available commands, their description and their usage
  • health get the health of the player
  • list get the players connected (Sometimes the packet is glitched, you can use the status button go get the players)
  • pos get the player position
  • disconnect disconnect the bot

Command Line Interface

Like the GUI, the CLI can use commands and send message to the server

Simply type anything in the CLI and type enter

 -a,--autoReconnect          Activate auto reconnect
    --cmd <arg>              Set the command that will be executed when
                             the bot is connected
    --cmdDelay <arg>         Set the delay between command execution
                             (Default=750ms)
 -d,--debug                  Activate debug
 -h,--host <arg>             Setup the host value (Default=127.0.0.1)
    --help                   Show this help page
    --langFile <arg>         Set the translation language for Minecraft
                             Message (Default=en_us.json) (Should be the
                             filename, placed in lang directory at the
                             same level as the jar)
 -p,--port <arg>             Setup the port value (Default=25565)
    --premium                If the user need to be logged through
                             Microsoft Authentication
    --reconnectDelay <arg>   Delay before reconnection
 -s,--status                 Display only the status of the server
 -u,--user <arg>             Email/Username of the user

Termux Guide

This project works great with Termux. You can use the CLI to operate from your phone. Here, is the guide to run this project on Termux.

First-Time Setup

  • Download and install Termux from here.
  • Run pkg install openjdk-17 curl jq -y
  • Run ⬇️
curl -o MinecraftBOT.jar -L $(curl -s https://api.github.com/repos/alwyn974/MinecraftBOT/releases/latest | jq -r ".assets[0].browser_download_url")

Starting The Bot

Now you can run the MinecraftBOT, see CLI Options

Example: java -jar MinecraftBOT.jar --host play.hypixel.net --autoReconnect --user Notch

Stopping The Bot

There is some method of stopping the bot in Termux:

  • Write .disconnect in the CLI (. is the default prefix for the commands)
  • See the termux notification bar, and close it
  • Force Stop the application (not recommanded)

Dependencies

Documentation

A javadoc is available here

💡 Don't forget to put a star on the project to support the project

minecraftbot's People

Contributors

alwyn974 avatar hugobaret avatar moisentinel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

minecraftbot's Issues

Invalid IPv6 Adress

I tried joining a 1.17.1 server with the program but it says invalid ipv6 address even though im on the server right now with the same ip.

joemama

some text not appearing

I am using this bot on a server, but text with "hoverEvent" and key bindings dissapear in my bot chat, is this my fault or not?

Wont start

Hi, im using java 11 and when i start the MinecraftBOT-1.0.8-all.jar it wont start i get following output :

pi@raspberrypi:/mcBot $ java -jar MinecraftBOT-1.0.8-all.jar
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: list
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: help
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: difficulty
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: health
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: food
[2021-07-04 19:07:12] [INFO] [MinecraftBOT] Register command: pos
pi@raspberrypi:
/mcBot $

Thats it.
What am i doing wrong?

[BUG]: content="Outdated client! Please use 1.18.2"

Describe the bug
After the bot received the authorization and ready to connect the server 127.0.0.1 for test, it gave the error and it seemed that it didn't be set correctly. I used the latest "-all" package.

Screenshots
image

Logs
[2022-12-28 15:10:46] [DEBUG] [MinecraftBOT] Authentication is pending, waiting for user to authenticate...
[2022-12-28 15:10:55] [DEBUG] [MinecraftBOT] Successfully authenticated [Because66666]
[2022-12-28 15:10:55] [DEBUG] [MinecraftBOT] Connecting to Minecraft server: 127.0.0.1:25565
[2022-12-28 15:10:55] [INFO] [MinecraftBOT] Disconnected: TextComponentImpl{content="", style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[TextComponentImpl{content="Outdated client! Please use 1.18.2", style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}]}

Informations (please complete the following information):

  • OS: windows 11
  • Java Version: 8 and 16
  • Minecraft BOT Version: [1.0.14 latest, the package you released on Aug 7,2022]
  • The interface you use: [e.g. GUI]
  • Account Type: [e.g. Microsoft]
  • Server Host and Port: [e.g. 127.0.0.1:25565]

Additional context
I think there must something wrong with my usage, and I hope someone could help me to deal with it. Thank you very much.

Hi buddy i am noob coder

buddy
i want toturial so can you give me i tried but failed i have MinecraftBOT-1.0.15-all.jar that file so help me how to run

Add password option to CLI

It will be great.
One script and you on server!

Thank for your project, others or not work or too old.
Good luck!

Auto reconnect

It'd be great if the bot can have an auto reconnect function
Sometimes it just disconnects from the server with no reason

[BUG]: Failed to translate message

Describe the bug
Don't return message from chat.

To Reproduce
Run Paper 1.19.2, Protocol Version: 757
Join with GUI
Send message in chat.

Expected behavior
Return in GUI message from chat.

Logs
[2022-12-29 15:25:45] [INFO] [MinecraftBOT] Failed to translate message: TranslatableComponentImpl{key="chat.type.text", args=[TextComponentImpl{content="SAN5_SkeLet0n", style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}, TextComponentImpl{content="hello", style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}], style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}

Informations:

  • OS: Linux
  • Java Version: openjdk 17.0.5
  • Minecraft BOT Version: latest
  • The interface you use: GUI
  • Account Type: Cracked
  • Server Host and Port: nevermindip.me

Suggestion: Reconnect Delay

I have an afk bot on my server but if he get kicked for afk and he cant connect 2 times in a row server refuses connection with "Connection throtted! Please wait before reconnecting"

my bad

java.lang.IllegalStateException: Cannot reply to EncryptionRequestPacket without profile and access token.
what should i do?

Download

I dont understand how to download the bot software?

[BUG]: Build failed

Build failed
PS E:\Downloads\MinecraftBOT-main> ./gradlew shadowJar
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':shadowJar'.

Could not resolve all dependencies for configuration ':runtimeClasspath'.
Could not find com.github.GeyserMC:MCProtocolLib:1.18.2-1.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/github/GeyserMC/MCProtocolLib/1.18.2-1/MCProtocolLib-1.18.2-1.pom
- https://jitpack.io/com/github/GeyserMC/MCProtocolLib/1.18.2-1/MCProtocolLib-1.18.2-1.pom
- https://alwyn974.github.io/maven/com/github/GeyserMC/MCProtocolLib/1.18.2-1/MCProtocolLib-1.18.2-1.pom
- https://repo.opencollab.dev/maven-releases/com/github/GeyserMC/MCProtocolLib/1.18.2-1/MCProtocolLib-1.18.2-1.pom
Required by:
project :

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 31s

CHAT

If someone says contains % content, the BOT will disconnect

Then an error: "Disconnected: Java. Util. UnknownFormatConversionException: Conversion = '%'

java.util.UnknownFormatConversionException: Conversion = '%'"
image

Can you make it useful to 1.17.1?

It's nice program but it seems it can't connect to 1.17.1 servers.
So please can you make it to be useful to 1.17.1 servers?

[2021-07-17 22:35:52] [INFO] [MinecraftBOT] Starting MinecraftBOT...

[2021-07-17 22:43:52] [INFO] [MinecraftBOT] Disconnected: TranslatableComponentImpl{key="Outdated server! I'm still on 1.17.1", args=[], style=StyleImpl{color=null, obfuscated=not_set, bold=not_set, strikethrough=not_set, underlined=not_set, italic=not_set, clickEvent=null, hoverEvent=null, insertion=null, font=null}, children=[]}

[2021-07-17 22:43:52] [INFO] [MinecraftBOT] Version: Spigot 1.17.1, Protocol Version: 756

[2021-07-17 22:43:52] [INFO] [MinecraftBOT] Player Count: 1000/1000

[2021-07-17 22:43:52] [INFO] [MinecraftBOT] Players: [§c§lANMotd §r§f§lInfo, §7§m----------, , §b§lOnline: §r§f§l%Online%, §b§lMaxPlayers: §r§f§l30, , §6Donate: §7§l§ourcratf.cn, , §fHave any §6questions§f?, Feel free to §6ask§f me on spigot!, , §7§m----------]

Support 1.19

Please support the 1.19 version(1.19 1.19.1 1.19.2)

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.