- Tested Minecraft Versions:
- Source Code:
This plugin is a gateway between Discord and Minecraft using Discords built-in API.
- discordmc.chat - required permission to get minecraft chat, joins, leaves and deaths delivered to discord
- discordmc.admin - admin permission, update notifications
- discordmc.command.<argument> - Replacing <argument> with the actual subcommand
- /discord logout - Log out of Discord
- /discord login - Log into Discord
- /discord lookup <user> - Lookup information about <user>
- /discord send - Send a test payload to see if channels are working
- /discord debug - Upload debug information to hastebin.com
- /discord toggle - Toggle functionalities for the user running the command
There is a few things to do before you can use this plugin.
First, visit the applications page and create a new app. Make sure you’re logged into your personal account! Fill in the information and click create.
Now, simply click “Add Bot User.”
Next, we need to add the bot to a server. Visit this page: https://discordapp.com/oauth2/authorize?&client_id=CLIENT_ID&scope=bot replacing “CLIENT_ID” with your client ID provided on the app page. Select the server you want to add it to (Note: You need the MANAGE_SERVER permission in a server to be able to add a bot to it) and then click Authorize.
You will see a Token under "APP BOT USER" which you have to enter in your configuration file
Congratulations! One part is done, your Discord guild now has a bot added.
Now go into your config.yml of DiscordMC and change the settings you wish. Important are the following:
"minecraft_to_discord" are the names of channels to which Minecraft messages are being sent.
"discord_to_minecraft" are the names of channels where messages you send from discord get send to Minecraft.
Please bare in mind that after successfully setting things up, a server restart is necessary to complete the installation.
If you like what I do, please consider leaving a donation <3
A Discord to Minecraft Chat Gateway for Spigot
Viewing mc messages in discord works, but when i try to send messages back from discord i get error: [sx.blah.discord.Discord4J] Unhandled exception caught dispatching event MessageReceivedEvent
java.lang.IllegalArgumentException: Path cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[paperspigot.jar:git-Paper-1335]
at org.bukkit.configuration.MemorySection.get(MemorySection.java:210) ~[paperspigot.jar:git-Paper-1335]
at eu.manuelgu.discordmc.MessageAPI.getFormattedMessage(MessageAPI.java:54) ~[?:?]
at eu.manuelgu.discordmc.MessageAPI.sendToMinecraft(MessageAPI.java:32) ~[?:?]
at eu.manuelgu.discordmc.listener.DiscordEventListener.userChat(DiscordEventListener.java:87) ~[?:?]
at sx.blah.discord.api.events.EventDispatcher$MethodEventHandler.handle(EventDispatcher.java:680) ~[?:?]
at sx.blah.discord.api.events.EventDispatcher.lambda$null$17(EventDispatcher.java:610) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_161]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_161]
AUTHOR! I'm running into an issue and I'm not sure if it's something I'm doing or something you would be able/willing to fix. So I am currently using this plugin purely to read messages in the chat and to send them to minecraft, not the other way around. I am using the plugin RelayItToDiscord for that because it simply looks 50x better. It uses a webhook and the profile picture is the users avatar and the name is the players name, just my opinion I think it is nicer than the bot. The only issue is the bot picks up on the webhook and sends it back to minecraft! So when you send a message on minecraft it gets sent back. Is this something I did wrong in the config or could you possibly have the bot check to see if the sender is a webhook/bot before sending the message back through?
A good plugin as always! Sets up fast and works well.
Only nagging issues is that nickname support for Discord to Minecraft omits messages from users who aren't using nicknames, that's all.
slightly unrelated note: am I correct in that the MessageAPI class will allow other plugins to use the DiscordMC bot?