Configuration


Default Configuration

Unlike most Bukkit plugins, Multi Chat
doesn't
use YAML files for configuration; It uses XML. XML is used instead of YAML due to my preference as a developer, and my loathing for YAML

Configuration Overview

<configuration>
   <ChatChannel>
      <channelName>Example</channelName>
      <prefix></prefix>
      <join_leave_messages>true</join_leave_messages>
      <permission>multichat.channel.join</permission>
      <creator>Console</creator>
      <chat_format>%sender%: %message%</chat_format>
   </ChatChannel>
</configuration>


Above is the default configuration; let's go over this a little bit.
The first line <configuration> is the root element for configuration; It's just the container / parent to Multi Chat's config.

The second element,<ChatChannel> and it's closing element, </ChatChannel>, is how we declare a new chat-channel ingame. It contains elements for the channels name, its prefix, whether it has join / leave messages, who the creator is, what permissions are needed to join, and the format to send the channel messages in

Below is where the channels name is defined; Example would be this channels name.

<channelName>Example</channelName>


Now the channels prefix. By default it's blank as it's not required to be set, though if a prefix isn't set the channel will default to using [ChannelName]
Though if we change whats in the prefix tag to something like what's below, every message in our channel will be prefixed with [Staff Chat] regardless of what the channels name is

<prefix>[Staff Chat] </prefix>

Multi Chat also has an option to enable / disable join and leave messages per-channel. To enable them set <join_leave_messages> to true, and to disable them set it to false

<join_leave_messages>true</join_leave_messages>


By default, Multi Chat locks all channels with the default permission to join channels, multichat.channel.join but if you want to change this so only users with the specified permission can join, you'd change what's in the <permission></permission> as shown below, where we have a channel locked to the staff.admin permission.

<permission>staff.admin</permission>


Each channel has a Creator, someone who "owns" the channel. Although this feature is mostly utilized in-game for private chats, changing a channels creator in configuration gives ownership to the user defined; Below is an example where I'd be the owner of a chat channel

<creator>Console</creator>


Lastly, but most importantly, the chat format. Each chat channel is (by default) using the Name: Message format. You can change this to however you wish. Below, I've changed the chat format to %sender% - %message% where %sender% is the sender of the message, the hyphen is the seperator, and %message% is the message that user sent.

<chat_format>%sender%: %message%</chat_format>


Chat Colors?

Multi Chat does indeed have support for coloring your chat, through ampersands (&), though due to the nature of XML you have to do something slightly different than &<colorcode> to color the chat.

In the example below I have a channel prefixed to look like [Trade Chat] and then resetting to normal.

<prefix>&amp;a[Trade Chat]&amp;r</prefix>

the &amp; translates directly to & when parsed from XML, and a is what I colored the prefix with. To assure that my entire channel isn't green text, I also include &amp;r (which is the &r colorcode) to reset the chat color to default.

Simple, right? :)


Comments

Posts Quoted:
Reply
Clear All Quotes