Skip to main content

72Bot

261 words·2 mins· ·
Projects Discord Minecraft

This chatbot requires a Minecraft and Discord bot account to work. It uses mineflayer to connect to a Minecraft server using the account credentials. However, the connection process is not 100% optimized and it is possible to get your account locked. The Minecraft account will disconnect from the server if it somehow loses too much health. As usual, the semantics can be modified in the source code.

On the Discord side, it sends all chat data to a webhook, customising the title, profile picture and so on. It uses a Discord bot to receive user commands to display player information like ping and tab lists.

The one thing this bot does not support is forwarding user messages to the Minecraft server. Adding support for this is rather simple but was not on my TODO list.

The bot supports the following commands

=== Help doc ===

[ Global command list ]
/ping       :: print the bot's ping
/tab        :: print the server's tab list
/entitylist :: list all entities within the bot's render distance
/xp         :: print the bot's XP stats
/var        :: print debugging variables

[ Owner only commands ]
/lock       :: disconnect the bot from the server and prevent it from reconnecting
/reconnect  :: (disable the lock and) reconnect to the server
/eval       :: execute any JS code

* Whitelisted users can send messages to the server chat (except the /kill command for obvious reasons)

The entire project is located inside of index.ts and is only about 200 lines. Pretty simple overall but it does what it needs to do.

Reply by Email