Flectone Logo FlectonePulse

Discord

Integration with Discord allows sending messages (Discord ↔ Minecraft) between the Minecraft server and a Discord server.

discord message
minecraft message

Information

For the bot to work correctly, enable three settings for your bot in the Discord Developer Portal

develop

Also grant the bot permissions for Read Messages, Send Messages, and Use Webhooks

Message Types

TypeExplanation
CHAT_GLOBALMessage from the global chat
CHAT_LOCALMessage from the local chat
AFKMessage from the afk action
ADVANCEMENT Message from an advancement
DEATHMessage from death
JOINMessage when a player joins the server
QUITMessage when a player leaves the server
FROM_DISCORD_TO_MINECRAFTMessage from Discord to Minecraft
FROM_TWITCH_TO_MINECRAFTMessage from Twitch to Minecraft
FROM_TELEGRAM_TO_MINECRAFTMessage from Telegram to Minecraft
COMMAND_MEMessage from the /me command
COMMAND_BALLMessage from the /ball command
COMMAND_BANMessage from the /ban command
COMMAND_BROADCASTMessage from the /broadcast command
COMMAND_COINMessage from the /coin command
COMMAND_DICEMessage from the /dice command
COMMAND_DOMessage from the /do command
COMMAND_HELPERMessage from the /helper command
COMMAND_MUTEMessage from the /mute command
COMMAND_POLL_CREATE_MESSAGEMessage from the /poll command
COMMAND_SPYPlayer monitoring sent to /spy
COMMAND_STREAMMessage from the /stream command
COMMAND_TRANSLATETOMessage from the /translateto command
COMMAND_TRYMessage from the /try command
COMMAND_WARNMessage from the /warn command
COMMAND_KICKMessage from the /kick command
SERVER_ENABLEMessage when the server starts
SERVER_DISABLEMessage when the server shuts down
Note

If you have custom chats with your own names, for example admin, you will need to specify CHAT_ADMIN. If you have your own groups from the vanilla module, you need to specify their names.


🌍 Localization

Path localizations → language.yml → integration.discord
discord:
  null_player: "This player does not exist"
  sender_name: "Discord"
  format_reply: "<fcolor:4><hover:show_text:'<fcolor:4><reply_message>'>[Reply to @<reply_user>]</hover> "
  custom_command:
    ping:
      content: "<player>'s ping is <replacement:ping>"
  info_channel:
    id: "TPS <replacement:tps>"
  message_channel:
    FROM_DISCORD_TO_MINECRAFT:
      content: "<fcolor:2><global_name> <fcolor:1>» <fcolor:4><reply><message>"
    CHAT_GLOBAL:
      content: "<final_message>"
discord:
  null_player: "Игрок не найден"
  sender_name: "Discord"
  format_reply: "<fcolor:4><hover:show_text:'<fcolor:4><reply_message>'>[Ответ на @<reply_user>]</hover> "
  custom_command:
    ping:
      content: "Пинг игрока <player> равен <replacement:ping>"
  info_channel:
    айди: "ТПС <replacement:tps>"
  message_channel:
    FROM_DISCORD_TO_MINECRAFT:
      content: "<fcolor:2><global_name> <fcolor:1>» <fcolor:4><reply><message>"
    CHAT_GLOBAL:
      content: "<final_message>"

null_player

Message if the player entered via custom_command is not found

sender_name

Name of sender (of integration itself), which will be used, for example, in another integration for placeholders

format_reply

Message format for the <reply> tag when the message is a reply to another one

custom_command

List of custom integration commands, where the key is the command name and the value is its message format

Example
custom_command:
  tps:
    content: "<tps>"

Command to get the tps value on the server. Don't forget to create it in integration.yml

Placeholders

You can use all placeholders that are used in the initial message for Minecraft

EXAMPLE FOR BAN MESSAGE

There is a <reason> placeholder there, so I can use <reason> inside Discord messages

There are also placeholders that will DEFINITELY be replaced in any message

  • <final_message> message sent to Minecraft
  • <final_clear_message> message sent to Minecraft without unicode emojis
  • <player> nickname of the player who sent the message
  • <message> raw message written by the player
  • <plain_message> formatted message written by the player
  • <reply> formatted reply message, it will be empty if the main message is not a reply
  • Obviously, all placeholders from PlaceholderAPI and FlectonePulse will also work

The message that will be sent from Discord to Minecraft has its own placeholders:

PlaceholderWhat it returns
<name>Global name of the Discord member
<global_name>Global name of the Discord member
<nickname>Nickname of the Discord member
<display_name>Display name of the Discord member
<user_name>Discord member's tag

info_channel

List of channel IDs and their names for displaying some information, such as TPS

message_channel

List of messages with their settings

message_name:
  content: ""
  webhook_name: "<player>"
  webhook_avatar: "https://mc-heads.net/avatar/<skin>/32.png"
    embed:
    color: ""
    title: ""
    url: ""
    author:
      name: ""
      url: ""
      icon_url: "https://mc-heads.net/avatar/<skin>/16.png"
    description: ""
    thumbnail: ""
    fields:
      - name: ""
        value: ""
        inline: false
    image: ""
    timestamp: true
    footer:
      text: ""
      icon_url: "https://mc-heads.net/avatar/<skin>/16.png"
Information

Message with all parameters

discord

If a parameter is empty or not written, it will not be used in the final message


⚙️ Setting

Path integration.yml → discord
discord:
  enable: false
  ignore_all_bots: true
  token: ""
  custom_command:
    ping:
      need_player: true
      aliases:
      - "!ping"
  presence:
    enable: true
    status: "ONLINE"
    activity:
      enable: true
      type: "PLAYING"
      name: "FlectonePulse"
      url: "https://flectone.net/pulse/"
  channel_info:
    enable: false
    ticker:
      enable: true
      period: 1200
  message_channel:
    FROM_DISCORD_TO_MINECRAFT:
    - "123456"
    CHAT_GLOBAL:
    - "123456"
  destination:
    type: "CHAT"
  sound:
    enable: false

enable

Enables or disables the functionality of the module

Warning
  • Before enabling, insert the Discord bot token
  • After enabling, it is RECOMMENDED to restart the server, otherwise the plugin may cause a freeze

ignore_all_bots

If enabled, messages from any users who are bots will be ignored. Otherwise, only the current bot's own messages will be ignored

token

Token of the Discord bot for connection. You can use environment variables, for example ${VALUE}

custom_command

List of custom integration commands, the key is the command name and it can be anything. Commands can ONLY be informational; they do not and will not execute anything on the server

ParameterExplanation
need_playerWhether to check the first command argument for a player name, e.g., !ping TheFaser
aliasesList of aliases for using the command
Example
custom_command:
  tps:
    need_player: false
    aliases:
      - "!tps"
      - "!tickpersecond"

Command to get the tps value on the server using !tps or !tickpersecond. Don't forget to create a message in localization

presence

discord presence

channel_info

discord channel info

message_channel

List of message types and Channel IDs in Discord

For example, I want a `/ban` command message to be sent from Minecraft to Discord

Copy the channel ID in Discord 1286666844358316083

Set COMMAND_BAN: "1286666844358316083"

message_channel:
  COMMAND_BAN: 
    - "1286666844358316083"

Localization can be left unconfigured; by default, the message will be sent with the <final_message> format

destination

Where the message will be sent

TypeExplanationRequires additional configuration?
ACTION_BARMessage above the player's inventoryYes
BOSS_BARMessage at the top of the screenYes
BRANDMessage in F3No
CHATMessage in chatNo
TEXT_SCREENMessage anywhere on the screenYes
TITLEFull-screen messageYes
SUBTITLEFull-screen message (bottom line)Yes
TAB_HEADERMessage in TAB (top)No
TAB_FOOTERMessage in TAB (bottom)No
TOASTMessage in the top right corner (achievement)Yes

sound

Sound playback


🔐 Permissions

Path permission.yml → integration.discord
discord:
  name: "flectonepulse.module.integration.discord"
  type: "TRUE"
  sound:
    name: "flectonepulse.module.integration.discord.sound"
    type: "TRUE"

name

Permission name

type

Permission type

TypeExplanation
TRUEAvailable to any player
FALSEAvailable to no one, must be granted separately (e.g., using LuckPerms)
OPAvailable to server operators
NOT_OPAvailable to NON-operators of the server

sound

Permission to use the sound

Last updated on

Edit on GitHub

On this page

Authors of page