Skip to content

the-lodestone-project/2b2t-tools

Repository files navigation


2b2t tools

🤖 Follow player movements, monitor chat messages and much more!

Node version Python javascript Hungarian

About

Have you ever wondered what really goes on in the infamous and chaotic world of 2b2t, Minecraft's oldest anarchy server? Ever wished you could get rare insights into the players, places, events, and rich history that have defined this boundary-pushing community over the past decade? Our new 2b2t API gives you access to data and tools to satisfy your curiosity and enhance your experience with this one-of-a-kind server.

Features

  • Log player join's and leave's
  • Log player movement
  • Log kills
  • Log chat messages
  • SQL database

Getting Started

Important

2b2t tools makes use of 2 bots and to run you will also require 2 paid Minecraft accounts.

Docker 🐳 (Not recommended at the moment)

Using Docker at the moment is not recommended as it may be slower updated than the python version below.

If you have Docker installed, you can easily get 2b2t tools up and running. Follow the steps below:

  1. Open your terminal.
  2. Pull the Docker image from the Docker Hub using the following command:
docker pull SOON!

After pulling the image, run the Docker container with the following command:

docker run -p 8000:8000 SOON!

This command will start 2b2t tools and map it to port 5000 on your local machine.

Open your web browser and navigate to http://localhost:5000/docs to access the docs and api endpoints. Please note that Docker must be installed and running on your machine to execute these steps. If you don't have Docker installed, you can download it from here.

Python 🐍

If you dont have Docker installed, you can easily get 2b2t tools up and running using python. Follow the steps below:

  1. Open your terminal.
  2. Clone the latest version of this repository using the following command:
git clone https://github.com/the-lodestone-project/2b2t-tools.git
  1. Move to the new directory:
cd 2b2t-tools
  1. Install all the dependencies using following command:
pip install -r requirements.txt

After cloning the repository and installing all the dependencies, run the python script with the following command:

python api/main.py

This command will start 2b2t tools and map it to port 5000 on your local machine.

Open your web browser and navigate to http://localhost:5000/docs to access the docs and api endpoints. Please note that Python and pip must be installed and running on your machine to execute these steps. If you don't have python and pip installed, you can download it from here.

Running and Logging In

The first time you run your bot, 2b2t tools will prompt you to log in. Follow the login prompts to authenticate your bots and connect it to 2b2t.org.

Using the API

2b2t tools provides the following APIs to get bot and server info.

Bot Status

GET /api/bot/status

Get the current status of the monitoring bot.

Response

{
  "position": "123", 
  "eta": "4h 10m",
  "username": "MyBot"
}
  • position: Queue position if in queue, else null
  • eta: Estimated time to join if in queue, else null
  • username: Bot's Minecraft username

Random Chat Message

GET /api/random 

Get a random chat message from the database.

Response

"Goodbye cruel world" 

Returns a random player chat message string.

Server Stats

GET /api/stats

Get stats on chat messages and players seen.

Response

{
  "total_messages": 473293,
  "total_players": 39482  
}
  • total_messages: Total chat messages logged
  • total_players: Total unique players logged

Player Lookup

GET /api/lookup/{username}

Get detailed info on a specific player.

Path parameter:

  • username: The Minecraft username

Response

{
  "username": "notch",
  "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
  "first_join": "2009-05-17T12:33:14.083Z",
  
  // other player stats...
}

Queue Lengths

GET /api/queue  

Get the 2b2t queue lengths.

Response

{
  "normal": 234,
  "priority": 22 
}
  • normal: Normal queue length
  • priority: Priority queue length

Contributors

Name Helped With GitHub Discord
Herodevc database setup and ideas @HeroDevc Herodevc

Roadmap

  • Add all features from moobot.