2b2t.org
Lodestone fully supports playing on 2b2t.org!
How to join 2b2t.org
Create a bot
💡
When coding a bot to play on 2b2t you need to make sure to set the host
to connect.2b2t.org
instead of 2b2t.org
.
Create the following bot.py
file in your project’s root directory:
2b2t.py
import lodestone
mcbot = lodestone.createBot(
host='connect.2b2t.org',
username='YOUR EMAIL',
auth='microsoft',
enableChatLogging=True # makes a database for the server and logs all the messages
)
@lodestone.Event(mcbot.bot, 'messagestr')
def chat(this, message, messagePosition, jsonMsg, sender, *args):
message = str(message).replace("\n\n","")
print(f"{sender}: {message}") # prints the position in the queue messages
print(mcbot.chatHistory(username="hausemaster")) # prints all the messages from this player
With the above configuration, Lodestone will create a bot that joins 2b2t.org
and uses the messagestr
event to print the position in the queue. It also print the chat history of hausemaster
. Other Lodestone bot creation configurations can be found
Here.
Run your bot
After coding your very own Minecraft 2b2t bot you can simply run the following command to start the bot!:
# can be python3 on some systems
python 2b2t.py
Next, check out the next section to learn about configuring the bot: