Skip to content

Announcement Configuration

Stampede edited this page Nov 13, 2023 · 3 revisions

This guide explains creating and editing Announcement Groups

Announcement Group Options

These options define the properties for this anouncement group

{
  "enabled": true,
  "interval": 30,
  "order": "RANDOM",
  "requirements": {},
  "discord": {},
  "formatting": [],
  "announcements": {}
}

Enabled

Sets whether this group should be enabled for automatic announcments.

"enabled": true

Interval

The amount of time in seconds between each announcement of this group

"interval": 30

Order

Determines the order that the announcements will be announced in. Currently available types: RANDOM and SEQUENTIAL

"items": {}

Requirements

Define requirements that must be met before any announcements in this group will be sent to the player. See Requirements for more information on requirements.

"requirements": {
  "example_requirement_1": {
    "type": "PERMISSION",
    "permission": "test.permission"
  }
}

Discord

Options to control how, or if, Discord webhook messages are sent when announced. See the Discord Options section below.

"discord": {
  "webhook_url": "",
  "username": "Username",
  "avatar_url": "https://i.imgur.com/lFAGX4A.png",
  "content": "Text message. Up to 2000 characters. %message%",
  "embeds": []
}

Formatting

A list of strings that will change the formatting of all chat message announcements. %message% will be replaced with the announcement's message. The formatting will be copied for each line in the announcement message.

"formatting": [
  "<red><b>! <red>Announcement <b>>> <gray>%message%"
]

Announcements

A MAP of Announcements that can be sent out. Each entry needs its unique string identifier. See the Announcement Options section below.

"announcements": {
  "test": {
    "message": [],
    "title": {},
    "action_bar": "",
    "sound": {}
  },
  "test_2": {
    "message": []
  }
}

Announcement Options

These options define how the announcements are displayed, when this specific announcement is announced.

"announcements": {
  "test": {
    "message": [
      "Chat Message Line 1",
      "Chat Message Line 2",
      "Chat Message Line 3"
    ],
    "title": {
      "title": "Title Message",
      "subtitle": "Subtitle Message",
      "duration": 5,
      "fade_in": 1,
      "fade_out": 1
    },
    "action_bar": "Action Bar Message",
    "sound": {
      "sound": "minecraft:block.note_block.bell",
      "volume": 1.0,
      "pitch": 1.0
    },
    "discord": true
  },
  "test_2": {
    "message": [
      "Chat Message Line 1"
    ],
    "discord": false
  }
}

Message

A list of strings that will be sent in the chat. If the formatting option is defined, this two will be combined using the %message% placeholder. See Formatting for more information on the usage.

"message": [
  "Chat Message Line 1",
  "Chat Message Line 2",
  "Chat Message Line 3"
]

Title

A title message is displayed in the center of the screen, with options for both the main-title and the sub-title.

"title": {
  "title": "Title Message",
  "subtitle": "Subtitle Message",
  "duration": 5,
  "fade_in": 1,
  "fade_out": 1
}

Title

The large text part of a Title.

"title": "Title Message"

Subtitle

The small text part of a Title.

"subtitle": "Subtitle Message"

Duration

The amount of time in seconds that the Title is on the screen for, not including the fade in and out times.

"duration": 5

Fade In

The amount of time in seconds that the Title takes to fade into the screen.

"fade_in": 1

Fade Out

The amount of time in seconds that the Title takes to fade out of the screen.

"fade_out": 1

Action Bar

An action bar message is displayed above the hotbar. It will only be displayed for a limited amount of time, which is not configurable.

"action_bar": "Action Bar Message"

Sound

A sound that will be played to the player.

"sound": {
  "sound": "minecraft:block.note_block.bell",
  "volume": 1.0,
  "pitch": 1.0
}

Sound

Resource location of a sound event.

"sound": "minecraft:block.note_block.bell"

Volume

The volume the sound is played at, between 0.0 and 1.0.

"volume": 1.0

Pitch

The pitch the sound is played at, between 0.0 and 1.0.

"pitch": 1.0

Discord

Sets if this announcement will be sent as a Discord webhook, only if the webhook URL is set. Defaults to true.

"discord": true

Requirements

Requirements are a list of checks that must succeed for a GUI to open, Item to display, or Action to activate, depending on where it's used. A MAP of requirements must be listed that are checked when activated. A list of deny and success actions can then be defined that will activate when any requirement has failed or all have succeeded, respectively. Each entry in the requirements section must have a unique string identifier. See Requirement Types for the types and additonal options.

"requirements": {
  "example_requirement_1": {
    "type": "PERMISSION",
    "permission": "test.permission"
  }
}

Type (required)

The type of action that this entry is. Must be in full capitalization. A list of types can be found in Action Types.

"type": "MESSAGE"

Comparison

The type of comparison that this requirement should do. The usage changes depending on the requirement used. See Comparison Types for more information. Defaults to == (equals) if not provided.

"comparison": "=="

Additional Options

Additional options are available depending on the type of action used. See Requirement Types for each type's additional options.

Requirement Types

Identifier Description Options
PERMISSION Check if the player has a permission
"permission": "<permission.node>"
DIMENSION Check if the player is in a dimension
"id": "<mod:id>"

Comparison Types

Identifier PERMISSION/DIMENSION
== Returns equality check
!= Returns opposite of equality check
>
<
>=
<=

Discord Options

Defines the formatting that announcement messages are sent as, when enabled. All options generally follow birdie0's Webhook Structure Guide.

"discord": {
  "webhook_url": "",
  "username": "Username",
  "avatar_url": "https://i.imgur.com/lFAGX4A.png",
  "content": "Text message. Up to 2000 characters. %message%",
  "embeds": [
    {
      "author": {
        "name": "SkiesAnnouncements",
        "url": "https://www.github.com/pokeskies/skiesannouncements",
        "icon_url": "https://i.imgur.com/lFAGX4A.png"
      },
      "title": "Title",
      "url": "https://www.github.com/pokeskies/skiesannouncements",
      "description": "Text message. You can use Markdown here. *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`",
      "color": 15258703,
      "fields": [
        {
          "name": "Text",
          "value": "More text",
          "inline": true
        }
      ],
      "thumbnail": {
        "url": "https://i.imgur.com/lFAGX4A.png"
      },
      "image": {
        "url": "https://i.imgur.com/lFAGX4A.png"
      },
      "footer": {
        "text": "Woah! So cool! :smirk:",
        "icon_url": "https://i.imgur.com/lFAGX4A.png"
      }
    }
  ]
}

Example Discord Webhook

Webhook URL

A Discord Webhook URL. See Intro to Webhooks by Discord for a guide to creating a URL.

"webhook_url": ""

Username

Sets the username of the Bot sending the message. Defaults to webhook name.

"username": "Username"

Avatar URL

Sets the profile picture of the Bot sending the message. Defaults to the webhook image.

"avatar_url": "https://i.imgur.com/lFAGX4A.png"

Content

The webhooks main message, outside of any embeds.

"content": "Text message. Up to 2000 characters. %message%"

Embeds

A list of embeds that will be sent with the message.

"embeds": [
  {
    "author": {
      "name": "SkiesAnnouncements",
      "url": "https://www.github.com/pokeskies/skiesannouncements",
      "icon_url": "https://i.imgur.com/lFAGX4A.png"
    },
    "title": "Title",
    "url": "https://www.github.com/pokeskies/skiesannouncements",
    "description": "Text message. You can use Markdown here. *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`",
    "color": 15258703,
    "fields": [
      {
        "name": "Text",
        "value": "More text",
        "inline": true
      }
    ],
    "thumbnail": {
      "url": "https://i.imgur.com/lFAGX4A.png"
    },
    "image": {
      "url": "https://i.imgur.com/lFAGX4A.png"
    },
    "footer": {
      "text": "Woah! So cool! :smirk:",
      "icon_url": "https://i.imgur.com/lFAGX4A.png"
    }
  }
]

Author

An author object with multiple sub options that define the embeds author.

"author": {
  "name": "SkiesAnnouncements",
  "url": "https://www.github.com/pokeskies/skiesannouncements",
  "icon_url": "https://i.imgur.com/lFAGX4A.png"
}

Name

The name of the author in the embed.

"name": "SkiesAnnouncements"

URL

The click URL for the author's name.

"url": "https://www.github.com/pokeskies/skiesannouncements"

Icon URL

The image for the author's profile picture in the embed.

"icon_url": "https://i.imgur.com/lFAGX4A.png"

Title

The title of the embed.

"title": "Title"

URL

The URL for the title of the embed.

"url": "https://www.github.com/pokeskies/skiesannouncements"

Description

The main text description of the embed.

"description": "Text message. You can use Markdown here. *Italic* **bold** __underline__ ~~strikeout~~ [hyperlink](https://google.com) `code`"

Color

The color of the embed. Either in Decimal (11141120), or in Hexadecimal (#aa0000)

"color": 15258703

Fields

A list of field options for the embed.

"fields": [
  {
    "name": "Text",
    "value": "More text",
    "inline": true
  }
]

Name

The name of the field.

"name": "Text"

Value

The value of the field.

"value": "More text"

Inline

Sets if the field will be displayed in-line. In-line fields are displayed on the same line, 3 per line, 4th+ will be moved to the next line.

"inline": true

Thumbnail

Sets the thumbnail content for the embed.

"thumbnail": {
  "url": "https://i.imgur.com/lFAGX4A.png"
}

URL

The image URL of the thumbnail.

"url": "https://i.imgur.com/lFAGX4A.png"

Image

Sets the image for the embed.

"image": {
  "url": "https://i.imgur.com/lFAGX4A.png"
}

URL

The image URL for the embed's image.

"url": "https://i.imgur.com/lFAGX4A.png"

Footer

The bottom footer for the embed.

"footer": {
  "text": "Woah! So cool! :smirk:",
  "icon_url": "https://i.imgur.com/lFAGX4A.png"
}

Text

The footer's text message.

"text": "Woah! So cool! :smirk:"

Icon URL

The image URL for the footer message.

"icon_url": "https://i.imgur.com/lFAGX4A.png"