Skip to content

Discord

Integration with Discord allows sending messages:

  • from Minecraft to Discord
  • from Discord to Minecraft

discord messageminecraft message

INFORMATION

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

develop

Also grant the bot the following permissions: read messages, send messages, and use webhooks

Message Types

TypeExplanation
CHAT_GLOBALglobal chat message
CHAT_LOCALlocal chat message
AFKMessage from the afk action
ADVANCEMENTAchievement message
DEATHDeath message
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 messages tracking for /spy command
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 their own names, for example admin, you will need to specify CHAT_ADMIN. If you have custom groups from the vanilla module, you need to specify their name

🌍 Localization

Path localizations → locale.yml → integration.discord

Default

yml
discord:
  null_player: "Игрок не найден"
  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>"
yml
discord:
  null_player: "This player does not exist"
  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>"

null_player

Message if the entered player via custom_command is not found

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

yaml
custom_command:
  tps:
    content: "<tps>"

A command to get the tps value on the server. Don't forget to create it in inegration.yml

Placeholders

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

EXAMPLE FOR BAN MESSAGE

There is a <reason> placeholder, 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:
PlaceholderReturns
<name>User global name in Discord
<global_name>User global name in Discord
<nickname>User nickname in Discord
<display_name>User display name in Discord
<user_name>User tag in Discord

info_channel

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

message_channel

List of messages with their settings

Message configuration

INFO

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

content

Message content discord content

webhook_avatar

Enable Discord webhook with player's avatar. Best to use https://mc-heads.net/avatar/<skin>/32.pngdiscord webhook

embed

Discord embed message discord embed

color

Color of the embed message

title

Title of the embed message

url

URL for the embed message

author

Author of the embed message

name

Name of the embed message author

url

URL of the embed message author

icon_url

URL of the embed message author's avatar. If you change it to your own, the URL must contain <skin>

description

Description of the embed message

thumbnail

Small image inside the embed message

fields

Bottom fields inside the embed message

name

Name of the field inside the embed message

value

Value of the field inside the embed message

inline

If enabled, the field will be placed in a column with other fields

image

Main image of the embed message

timestamp

If enabled, the embed message will include creation time

Bottom part of the embed message

text

Text in the bottom part of the embed message

icon_url

Image in the bottom part of the embed message

INFO

Message with all parameters discord

yaml
message_name:
  content: ""
  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"

⚙️ Setting

Path integration.yml → discord

Default

yml
discord:
  enable: false
  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's RECOMMENDED to restart the server, otherwise the plugin may cause freezing

token

Discord bot token 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 execute anything on the server and will not perform any actions

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

yaml
custom_command:
  tps:
    need_player: false
    aliases:
      - "!tps"
      - "!tickpersecond"

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

presence

discord presence

Bot status configuration

enable

Enables or disables custom bot status

status

ModeExplanation
UNKNOWN-
ONLINEOnline
DO_NOT_DISTURBDo not disturb (Online)
IDLEOnline but idle
INVISIBLEInvisible
OFFLINEOffline

activity

Bot activity in Discord

enable

Enables or disables activity

type
TypeExplanation
UNKNOWN-
STREAMINGStreaming
LISTENINGListening
WATCHINGWatching
CUSTOM-
COMPETINGCompeting
name

Activity name

url

Activity URL

channel_info

discord channel info

Information channels configuration

enable

Whether information channel is needed

ticker

Updates every certain interval of time

HOW TO USE TICKER?

Change false to true and restart FlectonePulse using the /flectonepulse reload command. Additional ticker settings will appear AUTOMATICALLY

enable

Whether to update or not

period

How often in ticks it should update

message_channel

List of message types and channel IDs in Discord

For example I want messages from Minecraft command /ban to be sent to Discord

  1. Copy the Discord channel ID 1286666844358316083
  2. Write COMMAND_BAN: "1286666844358316083"
yaml
message_channel:
  COMMAND_BAN:
    - "1286666844358316083"

You don't need to configure localization, by default the message will be sent with the format <final_message>

destination

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

To change this, replace the value type: here and restart FlectonePulse using the command /flectonepulse reload. Additional settings will appear AUTOMATICALLY.


ACTION_BAR

action bar

yaml
destination:
  type: "ACTION_BAR"
  times:
    stay: 60

- times

FieldExplanation
stayTime in ticks to keep the message visible

BOSS_BAR

action bar

yaml
destination:
  type: "BOSS_BAR"
  duration: 100
  health: 1.0
  overlay: "PROGRESS"
  color: "BLUE"
  play_boos_music: false
  create_world_fog: false
  darken_screen: false

- duration

Duration for displaying the message.

- health

How full the boss bar will be.

- overlay

TypeExplanation
PROGRESSA single line
NOTCHED_6Divided into 6 parts
NOTCHED_10Divided into 10 parts
NOTCHED_12Divided into 12 parts
NOTCHED_20Divided into 20 parts

- color

Display color.

Type
PINK
BLUE
RED
GREEN
YELLOW
PURPLE
WHITE

- play_boos_music

Whether to play boss music with the message

- create_world_fog

Whether to create world fog with the message

- darken_screen

Whether to darken the screen with the message


TEXT_SCREEN

text screen

WARNING

This only works on version 1.19.4 and above. On older versions, CHAT will be used instead

yaml
destination:
  type: "TEXT_SCREEN"
  background: "#00000040"
  has_shadow: false
  animation_time: 2
  live_time: 10
  width: 100000
  scale: 0.5
  offset_x: 0.0
  offset_y: -0.3
  offset_z: -0.8

- background

The background color of the message, which includes transparency (alpha channel). Website for choosing a color

- has_shadow

Enables text shadow

see_through

Enables text transparency against water and clouds (so you cannot see through water)

- animation_time

Time in seconds for the appearance and disappearance animations. If set to 0 or less, there will be no animation

- live_time

Time in seconds for the text to be displayed. If set to 0 or less, the text won't appear

- width

Text length per line in pixels. If the text is longer, it will wrap to the next line

- scale

Text size. If negative, the text will be flipped

- offset_x

Offset along the X coordinate (right +, left -) relative to the center of the player's screen

- offset_y

Offset along the Y coordinate (up +, down -) relative to the center of the player's screen

- offset_z

Offset along the Z coordinate (forward +, backward -) relative to the center of the player's screen


TITLE (or SUBTITLE)

title

yaml
destination:
  type: "TITLE" (or "SUBTITLE")
  subtext: ""
  times:
    fade_in: 20
    stay: 60
    fade_out: 20

- subtext

Message for the second part of the display. For example, if TITLE is selected, subtext will be shown below it, and vice versa

- times

FieldExplanation
fade_inTime in ticks for the message to appear
stayTime in ticks to keep the message visible
fade_outTime in ticks for the message to disappear

TOAST

toast

yaml
destination:
  type: "TOAST"
  icon: "minecraft:diamond"
  style: "TASK"

- icon

Achievement icon, which can be any Minecraft item (must specify the full path)

- style

Achievement type (TASK regular, GOAL goal, CHALLENGE challenge)

sound

Sound playback

How to use?

Replace false with true and restart FlectonePulse using the /flectonepulse reload command. Additional sound settings will appear AUTOMATICALLY

yaml
sound:
  enable: true
  volume: 1.0
  pitch: 1.0
  category: "HOSTILE"
  name: "minecraft:entity.llama.spit"
FieldTypeExplanation
enablebooleanEnables sound functionality
volumefloatSound volume from 0 to 1.0
pitchfloatSound pitch from 0 to 1.0
categoryStringCategory from MASTER, MUSIC, RECORD, WEATHER, BLOCK, HOSTILE, NEUTRAL, PLAYER, AMBIENT, VOICE
nameStringSound name, for example minecraft:entity.llama.spit

🔐 Permissions

Path permission.yml → integration.discord

Default

yml
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
FALSENot available to anyone, must be granted separately (e.g., using LuckPerms)
OPAvailable to server operators
NOT_OPAvailable to not server operators

sound

Permission to use sound