Intermission

0 Downloads

Intermission is an announcement plugin which mainly features:

  • Multiples set of announcements, and for each:
  • A permission to view that set (optional)
  • A different permission to subscribe and unsubscribe from that set (optional)

This allows server administrators (for instance) to:

  • Create a "General" set of announcements for all players that the only admin team can unsubscribe from
  • Create a "Admin updates" set that only the admin team can view
  • Create a "Did you know" set that all players can unsubscribe from
  • Create a "Roleplaying rules" set that only role players can and must see

Complete features

  • Create multiple sets of announcements
  • Choose to only show certain announcements to certain players
  • Choose announcements that can be subscribed/unsubscribed from
  • Only let certain players (admins or high rank players) unsubscribe from certain announcements
  • Announcements pick up messages from one or more text files separate from the configuration file itself
  • Announcements can have a prefix and a suffix
  • Announcements can be formatted with the ampersand & for color and style
  • Messages can include the player name, player display name, world and block location
  • Shuffle announcements (randomize)
  • Periodical announcements
  • Delay announcements on server start (so that announcement sets with the same interval are not displayed at the same time)
  • Choose to display announcements into the server console (and logs)

Message formatting

All messages can use the & character as a substitute for the ยง character, used to color or style the text.

  • In the display.format configuration of a set, %s will be replaced with the picked message.
  • In the picked message (and only in the picked message), you can optionally use these variables:
    • %1$s will be replaced by the raw player name who will receive the message
    • %2$s will be replaced by the player display name (which may contain decoration, color and symbols)
    • %3$s will be replaced by the world name the player is currently in
    • %4$s will be replaced by the block world coordinate X (a number with no decimals)
    • %5$s will be replaced by the block world coordinate Y
    • %6$s will be replaced by the block world coordinate Z

Example of display.format to surround a message with a prefix and a suffix:

      format: '&cAnnouncement&f: %s'
      format: '&c[Annoucement]&f %s'
      format: '&cHey! &r%s &cHappy new year!'

Example of messages:

&fType &l/clear&f to clear your inventory. &l/clear -a&l will also remove items from the hotbar
&fType &l/tploc %4$s,%5$s,%6$s&f to teleport to a certain location
&fType &l/enchant %1$s dig_speed&f to enchant your current item with an Efficiency enchantment
&f%2$s, please cast your vote on our website www.example.org to choose our next event! You will receive a &cfull stack of Fireworks&f as a reward!

Commands

  • intermission_list
    • When used in-game, lists all announcement sets you can view. Gray names means you are forced to view the announcements. Red names means you are unsubscribed. Blue names means you are subscribed. If the tone of the color is dark, it means you have no preference and are using the default value.
    • When used from the server console, this lists all announcement sets. Red names means the set is disabled. Blue names means the set is enabled. A two numbers shows up at the right of each enabled announcement (only one if the set is not subscription based): The number on the left is the number of online players that can currently see the announcements (they are either forced or subscribed to it), the number on the right is the number of online players who have the right to see the announcements.
  • intermission_subscribe <vendor>: Subscribe to an announcement set. Players can not subscribe to announcements they can not see or are forced to view.
  • intermission_unsubscribe <vendor>: Unsubscribe from an announcement set. Players can not unsubscribe from announcements they can not see or are forced to view.
  • intermission_info <vendor>: Displays information about an announcement set Players can not display information from announcements they can not see.
  • intermission_reloadconfig: Reloads the configuration file and then reloads the messages
  • intermission_reloadmessages: Reloads the message files. This operation does not look into config.yml for new announcement files. Announcements sets that use shuffling will be shuffled again. Announcement that do not require shuffling will not be rewinded: If the next message that was about to be displayed was line 7, it will still display line 7 after messages are reloaded (unless line 7 does not exist anymore, in this case, it will display line 1)
  • intermission_displaynow <vendor>: Displays the next line of an announcement set. This does not reset the time before a new announcement is made. This command works on disabled announcement sets, and user subscription preferences apply

Almost every command in this list requires a different permission node. Consider using intermission.user.* for user commands, and intermission.admin.* for admin commands.

Configuration

  • globalconfig
    • enable:
      • (true) Intermission will run periodical announcements
      • (false) Admins will be able to execute intermission_displaynow but players will not be able to alter their subscriptions. Preferences apply
      • visibility:
        • enable:
          • (true) The set is visible only to players who have a certain permission (they are called eligible players)
          • (false) The set is visible to all players
        • node: Permission node to be eligible to see the announcements
    • display:
      • on_subscribe: Message when a player successfully subscribed to a set
      • on_unsubscribe: Message when a player successfully unsubscribed from a set
      • on_invalid: Message when the player cannot subscribe to a set, or the set isn't visible to that player, or the set does not exist
      • on_info_forced: Information message of a set the player is forced to view
      • on_info_subbed: Information message of a set the player is subscribed to
      • on_info_unsubbed: Information message of a set the player is unsubscribed from
      • on_info_invalid: Message when the player tries to obtain information on a set that the player cannot see or that does not exist.
  • vendors: (This is the location where all announcement sets are defined)
    • announcements: (A set called "announcements". You should only use lowercase names without spaces)
      • enable: (true/false) Will the set run?
      • description: A short description that displays on intermission_info
      • subscription_based:
        • enable:
          • (true) The set can be subscribed from/to by eligible players
          • (false) All eligible players will be forced to receive the messages
        • default:
          • (true) The set is by default subscribed from/to
          • (false) The set is by default unsubscribed from/to
        • permission_to_change_subscription:
          • enable:
          • (true) The subscription preference is only available to a certain permission: Eligible players who don't have that permission will be forced to receive the messages
          • (false) The subscription preference is available to all eligible players
        • node: Permission node to be able to change the subscription
      • display:
        • format: Format of the announcement
        • period: Time in seconds between announcements
        • delay: Time in seconds before the first announcement after the server has started (if this value is not defined, then it will use the period value)
        • shuffle:
          • (true) The messages are shuffled after the messages have been loaded
          • (false) The messages will display in the order given in the files. The first message displayed after a server start will always be the first message in the list
          • console: (true/false) Will the message be sent to the console/server logs?
      • messages: (A list of text files in the plugins/Intermission/ folder to read messages from)

Notes

  • The visibility options has precedence over the subscription options: A player cannot subscribe or unsubscribe from sets they cannot see
  • If a player changes its subscription preference, but then loses the right to change the subscription, that player preference will be ignored (the default subscription value is used)
  • If a player changes its subscription preference, but then is no longer eligible to view the set, that player preference will be ignored
  • Blank lines in the text file are ignored
  • If you have two announcement sets with the same periods (or a multiple), the announcements may display at the same time: Consider using the delay value so that all announcements arrive at different times
  • It makes no sense having a subscription set by default to false and having the subscription change to a certain permission node enabled
  • Messages are only shuffled once when the messages have done loading: They will play in the same order over and over until the messages are loaded again (by an admin or with a server restart)
  • If a message is about to be displayed when the server is empty, this message will display next time after another full cycle (if an announcement should display every 2 hours, the message that was meant to be displayed will be displayed in 2 more hours)
  • User preferences are stored in plugins/Intermission/players/<lowercase player name>.yml

Example

globalconfig:
  enable: false
  display:
    on_subscribe: '&bYou are now subscribed to &f%s&b.'
    on_unsubscribe: '&cYou are now unsubscribed from &f%s&b.'
    on_invalid: '&7You cannot perform this operation / You cannot change this subscription.'
    on_info_forced: '&7%s&f: %s'
    on_info_subbed: '&b%s&f: %s'
    on_info_unsubbed: '&c%s&f: %s'
    on_info_invalid: '&7You cannot obtain this information.'
vendors:
  announcements:
    enable: false
    description: 'General announcements.'
    subscription_based:
      enable: true
      default: true
      permission_to_change_subscription:
       enable: true
       node: intermission.admin
    visibility:
      enable: false
      node: ''
    display:
      format: '&cAnnouncement&f: %s'
      period: 900
      shuffle: false
      console: true
    messages:
    - announcements.txt

Source code

https://github.com/Hurricaaane/Intermission