Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
AstralBot

AstralBot

Minecraft Mod doubling as a Discord Bot, initially made for Create: Astral

3,131
4
Management
Social
Utility

Compatibility

Minecraft: Java Edition

1.21.x
1.20.4
1.20.1
1.19.2
1.18.2

Platforms

Fabric
Forge
NeoForge

Supported environments

Server-side

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Visit wiki Join Discord server

Creators

Erdragh
Erdragh Owner
null2264
null2264 Contributor

Details

Licensed MIT
Published last year
Updated 3 months ago
DescriptionGalleryChangelogVersions

AstralBot

build workflow License Environment

This is a Minecraft mod and Discord Bot in one package. It's intended for the Create: Astral Modpack's official server, but it's implemented cross-platform to be usable by others too. The goal is to be easy-to-use and accessible for non-technical server admins, while allowing true complexity for power users.

Features

These features are the core of what this bot will do. See the Status section to see how much is already implemented.

  • Discord and Minecraft account linking, optionally requiring this to be whitelisted
  • Discord and Minecraft chat synchronization, optionally via webhook for improved readability
  • FAQ commands using Markdown files without needing to restart the server

Dependencies

This mod has a few dependencies, some of which are not specified directly as they're technically optional:

  • The Kotlin Implementation for the platform you're running. (e.g. Kotlin For Forge or Fabric Language Kotlin)
  • The (Neo-)Forge Config API (Included in Neo/Forge, extra mod for Fabric)

Implementation

  • JDA library to communicate with the Discord API.
  • Kotlin for the improved development experience over Java
  • JetBrains Exposed to communicate with the Database

Configuration

The following things will be configurable:

  • Required linking to be whitelisted (default: off)

  • Chat synchronization with imitated Discord Users:

    1. No user imitation (The bot will write the messages under its own name)
    2. (If possible) Minecraft user imitation (The Minecraft usernames and heads will be used for messages)
    3. (Only available if requiring linking for whitelist) Discord user imitation (The messages will be written under the linked Discord name)

    Default: Minecraft user imitation (if webhook available is set, otherwise no imitation)

  • Managing FAQs through a command interface (default: off)

  • Database connection. Uses an SQLite database by default

Status

  • [x] Whitelisting
  • [ ] FAQ Commands
    • [x] Reading Markdown files
    • [x] Updating suggestions without restart
    • [ ] Management/Creation via commands
  • [x] Chat synchronization
    • [x] Minecraft to Discord
    • [x] Discord to Minecraft
    • [x] User imitation on Discord. Either uses Minecraft avatars or Discord avatars

Running

There is no public instance of this bot/mod available. To use it, create a new Application on the Discord Developer Portal and configure it to have the three privileged gateway intents: PRESENCE, SERVER MEMBERS and MESSAGE CONTENT.

Copy the bot token and store it somewhere safe (like a Password Manager) and never show it to anybody else. To make sure the token gets read by the bot, it has to be in either an Environment Variable DISCORD_TOKEN where the running Minecraft server can access it or in the config file under the key token. You could for example modify a start.sh script on a Unix-like system to export it or start the shell script with it set directly:

startmc.sh:

export DISCORD_TOKEN=<place token here>

java ... # java command that starts the server

or

DISCORD_TOKEN=<place token here> startmc.sh # Start the script with the env variable set

After starting the server, you can go into the OAuth2 URL builder on the Discord Developer Portal and generate a URL with the bot and applications.command permissions. Use the generated URL to have the bot join your server.

To be able to use user imitation, which makes the chat synchronization more readable, the bot will try and create a webhook in the configured chat synchronization channel. This means it will need to have the permission to manage webhooks. If you don't want that you can manually create a webhook in the channel where you want the messages synchronized and set it in the webhook.url option in the config for the mod.

Modrinth is open source.

main@4b75cb8

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.