Cuberite Forum
Discord Chat with CubeRite - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Discussion (https://forum.cuberite.org/forum-5.html)
+--- Thread: Discord Chat with CubeRite (/thread-3298.html)



Discord Chat with CubeRite - Greaper88 - 05-24-2020

Just thought that this may be useful for some of you server admins out there. Particularly those of you who have a Discord server, and may be familiar with DiscordSRV and similar plugins for Bukkit-based servers. For those of you who don't know, these plugins allow the Minecraft server to cross-chat with a Discord server. Unfortunately, there is no such plugin for Cuberite, however, I have found a method that works.

Requirements:
You will need to use either BungeeCord or Waterfall. You can get BungeeCord from www.spigotmc.org or Waterfall from papermc.io

From here on out, I will refer to both of these proxies as "BungeeCord" or "Bungee" unless special clarification is needed as Waterfall is just a performance tweaked fork of Bungee.

You will also need this Plugin, it is the only one I have found that works without needing a companion plugin on the backend servers. https://www.spigotmc.org/resources/discord-chat-with-minecraft-spigot-bungeecord.59550/
This plugin requires the use of a dependency, which is found at https://www.spigotmc.org/resources/discord-bot-api-jda.49783/

BungeeCord/Waterfall Setup:
There are multiple tutorials available online, and any tutorials for BungeeCord will work exactly for Waterfall. If you only plan to run one server, I strongly recommend setting the "ping_passthrough:" line to "true" as this will pass the information from your Cuberite server to your players' server lisitng instead of Bungee's information.

Install the plugins to the /plugins folder in your Bungee folder. You will need to start, then "end" the server to generate the initial files.

Server Setup:
You will need to configure the settings.ini for CubeRite to work with bungee. Thise means setting Authenticate=0 and setting AllowBungeeCord=1.

Discord Setup:
You will need to create a new app and add a bot to it. Again, there are tutorials available for this.

Plugin Setup:
Once you have stopped the server, you will need to configure the plugin. The "DiscordBot API" plugin needs nothing to be changed. It's just a framework that the actual chat plugin uses to function. Go into the "DiscordChatWM" folder inside your plugins folder and open the "config.yml" file for editing. On Windows you can use Notepad, Notepad++, or any other OS the default system text editor should work no issues. You will need to tell the plugin how to work. I have an example config posted, this is the one I use with my anarchy network. The most important setting (aside from the Discord and bot ids of course) is probably "use_only_bungeecord:" This needs to be set to "true" for things to work properly. I also disable the "use_verify" and keep in mind that the bot's variable of <role> also does not work, so is best removed. I personally replace it with [Discord] so the players know it's from the Discord.
Code:
# Plugin made by alandioda [BungeeCord]

# [Bot settings]
TOKEN: Your bot token here
guild_id: Your Discord server ID
discord_channel_id: the Channel ID you want the bot talk in and listen to
# If you want to use only this bot on the bungeecord.
use_only_bungeecord: true

# [Verify settings]
use_verify: false
# Write \@<role> to get role id on discord
verifed_rold_id: 000000000000000000
# verified chat format
minecraft_chat_verified: '<<name>> <message>'
discord_chat_verified: '**<name>** <message>'

# [Player count settings]
# If you want to display player count on the discord bot.
show_players_online: true
# Set costume display. <number> will be replaced
# with number of players playing on the network.
bot_playing_text: '<number> playing on the network!'
# Status: DEFAULT, LISTENING, STREAMING, WATCHING
bot_status: LISTENING
# This will display separate player count on the topic of a discord channel.
# This will only work if separate_the_servers is enabled.
display_separate_server_player_count: true
# Display for servers. <number> will be replaced with the number of players.
# <name> will be replaced with the server name.
separate_server_count_text: Currently <number> players on the <name> server.

# [Roles]
# Add all of the roles that you want to be displayed when players send messages.
allowed_displayed_roles:
- 000000000000000000

# [Chat Minecraft]
# <name> will be replaced with the discord user name.
# <message> will be replaced with the message from discord message.
# <role> will be replaced with the higest role from discord.
minecraft_chat: '[Discord] <<name>> <message>'
use_minecraft_nicknames: false
# If enabled it will show emoji names in minecraft chat.
show_emoji_names: true

# [Chat Discord]
# <name> will be replaced with the minecraft user name.
# <message> will be replaced with the message from minecraft chat.
discord_chat: '**<name>** <message>'
use_discord_nicknames: true
# If false users from discord can't use color codes.
colorcodes_enabled: false

# [Join and leave messages]
discord_joined_message_enabled: true
discord_left_message_enabled: true
# Message structure when a player joines the network.
# <name> will be replaced with the minecraft user name
discord_joined_message: '**<name> joined the game**'
discord_left_message: '**<name> left the game**'
# Border (Embed) for Join messages
use_fancy_border: true
# Select the color of the border:
builder_color: f8fc19

# [Server separation settings]
separate_the_servers: false
# Server names (server_name: 000000000000000000 <- channel id)
server_names:
   ExampleServer: 000000000000000000