The Chat Module handles changing how chat looks when players send public messages. Whilst there are no commands involved, the chat module is perhaps the module that is most visible on the server.
Chat works best when coupled with a permission plugin that supports options.
In the main.conf
file, chat
section, the following options are available:
modifychat
: if true
, the chat format will be modified.template.prefix
: The prefix to all messages sent, if set. Set to empty to disable.template.suffix
: The suffix to all message sent, if set. Set to empty to disable.If modifychat
is set to true
, when someone sends a public chat message, the message will start with whatever is
specified in template.default.prefix
, and will be followed by whatever is specified in template.default.suffix
.
The templates support various tokens.
{{name}}
: The player’s name{{displayname}}
: The player’s set display name. Usually, this is the users nickname if they have one, or their in-game name otherwise.{{prefix}}
: The player’s prefix tag, if one is set in the permission plugin. This is NOT the same as the template prefix, defined above.{{suffix}}
: The player’s suffix tag, if one is set in the permission plugin. This is NOT the same as the template suffix, defined above.The templates also support Minecraft colour codes,
replacing §
with &
.
If you want to change the colour of a player’s name in general, don’t add a colour code to the end of the prefix. Instead,
use the namecolor
permission option, as this will tell Nucleus to use that colour all across the plugin.
Different groups can have different chat templates to the default defined in template.default
. To give a group a different template,
simply add the name of the group and the template like so. The target user (or permission group) then needs to have the name of the desired
group set to the nucleus.chat.group
permission option/meta like so:
Note that the option must be case sensitive. Multiple entries can be added to the config file like this:
templates {
...
group-templates {
Admin {
prefix="{{prefix}} {{displayname}}&f A>: "
suffix=" {{suffix}}"
}
Moderator {
prefix="{{prefix}} {{displayname}}&f M>: "
suffix=" {{suffix}}"
}
}
}
To set a player’s or group’s prefix or suffix tag, a permissions plugin that supports options must be installed, such as
PermissionsEx. To set the prefix tag, simply set the desired tag to the prefix
option, similarly, with the suffix tag,
set the suffix
option. Both these tags support colour codes, as above.
For example, to set the the prefix [Mod] for the “mod” group, run the command (based on your permissions plugin):
Nucleus, as of 0.9, supports custom tokens other than “prefix” and “suffix”. In the chat formatting string, you can add the following tags:
{{o:[option-name]}}
- replaced by the text in option “rank”, if any.{{o:[option-name]:s}}
- replaced by the text in option “rank”, if any. If there is text in the option, adds a space afterwards.In both cases, the option name is whatever you called the option. So, if you wanted a token called rank
on a moderator with the
string [Rank]
before the prefix, you would run the following command (again, this varies based on your permissions plugin):
then have the following template:
"{{o:rank:s}}{{prefix}} {{displayname}}&f>: "
If you also had a default group with the tag “[Default]”, this would display “[Rank] [Mod] name> chat” for moderators, and “[Default] name> chat” for default players.
Messages themselves can also be formatted using colour codes and formats, prefixing the codes with &
characters.
“Magic” characters can also be sent using &k
, and reset using &r
.
The message formatting can be controlled by permissions - which are listed below.
URLs are detected by Nucleus and are made clickable. This requires the nucleus.chat.url
permission.
If you have a compatible permissions plugin installed, setting a player’s (or their group’s) namecolor
/namecolour
permission option will colour their
display name that colour be default. This can be overridden by players who can use colour codes in their nicknames.
This option accepts both names of colours and single character Minecraft colour codes - that is, black
and 0
will both colour the player’s name
in black.
As an example, if you wanted the default name colour for a player in the “mod” group to be aqua, you could run the following command (varying based on your permission plugin):
If you have a compatible permissions plugin installed, setting a player’s (or their group’s) chatcolor
/chatcolour
permission option will colour their
chat that colour by default. This can be overridden by players who can use colour codes in their chat.
Like namecolour
, this accepts both named colours and single character colour codes.
As an example, if you wanted the default chat colour for a player in the “mod” group to be aqua, you could run the following command (varying based on your permission plugin):
If you have a compatible permissions plugin installed, setting a player’s (or their group’s) chatstyle
permission option
will set the style of their chat automatically. This can be overridden by players who can use colour codes in their chat.
chatstyle
can accept multiple styles which are comma separated, and both single character and named styles are accepted.
To set the style as bold and italic, set the chatstyle
option to l,o
or bold,italic
.
If you were to add the italic and bold styles to the mod group, an example command to run would be:
The following are incompatibilities that may occur with this module, along with how to resolve the problem. For the full mod/plugin incompatibility list, see the compatibility page.
Reason: Simple Tags overrides the "header" section of the chat message on a late priority and will remove anything there, including Nucleus tags.
Resolution: Remove SimpleTags.
Reason: FTB Utilities alters the chat and may override the Nucleus configuration.
Resolution: Disable FTB Utilities chat-override options, specifically the option "B:override_chat".
Aliases:
/me
, /action
Usage: /me <message…>
Default Role: USER
Basic Command Permission: nucleus.me.base
Permissions
nucleus.me.exempt.cost
- Default Role: ADMIN nucleus.me.base
- Default Role: USER nucleus.me.exempt.cooldown
- Default Role: ADMIN nucleus.me.exempt.warmup
- Default Role: ADMIN
This command is an equivalent to the following command(s) in Essentials:
/me
, /action
, /describe
Permission | Suggested Role | Description |
---|---|---|
nucleus.chat.magic | ADMIN | Allows user to use magic characters in chat. |
nucleus.chat.url | ADMIN | Allows user to type clickable URLs in chat. |
nucleus.me.base | USER | Allows the user to run the command /me |
nucleus.me.exempt.cooldown | ADMIN | Allows the user to bypass the cooldown for /me |
nucleus.me.exempt.cost | ADMIN | Allows the user to bypass the cost for /me |
nucleus.me.exempt.warmup | ADMIN | Allows the user to bypass the warmup for /me |
# Some mods and plugins move the Minecraft player prefix to the main message body. If this is the case, turn this on, and Nucleus # will try to remove it. check-body-for-minecraft-prefix=false # The prefix to use when someone uses "/me". me-prefix="&7* {{displayName}} " # If "true", Nucleus will attempt to modify the chat modify-chat=true # If true, Nucleus will take the message and try to apply it's own transforms to it. This may overwrite other plugins who do processing super early, so turn this off if you are having problems. modify-main-message=true # If false, Nucleus will prepend it's prefixes/headers with those already set buy other plugins. If true, it will overwrite them. overwrite-early-prefixes=false # If false, Nucleus will prepend it's suffixes/footers with those already set buy other plugins. If true, it will overwrite them. overwrite-early-suffixes=false # If true, Nucleus will try to remove any text formatted in blue and underlined that Minecraft has tried to turn into a link. remove-link-underlines=true templates { # The default chat template if no group templates apply. default { # The default colour for a player's chat if the "chatcolour" permission option isn't set on the player or group. Takes the same input as the "namecolour" option set to "" to retain default behaviour (no change of colour). Do not include the "&" character. default-chatcolour="" # The default styles for a player's chat if the "chatstyle" permission option isn't set on the player or group. Takes the same input as the "chatstyle" option set to "" to retain default behaviour (no style). Do not include the "&" character. Multiple styles must be separated by commas. default-chatstyle="" # The default colour for a player's name if the "namecolour" permission option isn't set on the player or group. Takes the same input as the "chatcolour" option set to "" to retain default behaviour (no change of colour). Do not include the "&" character. default-namecolour="" # The default styles for a player's name if the "namestyle" permission option isn't set on the player or group. Takes the same input as the "namestyle" option, set to "" to retain default behaviour (no style). Do not include the "&" character. Multiple styles must be separated by commas. default-namestyle="" # Sets the prefix to a message. {{prefix}} - prefix (set as an option in a permission plugin), {{suffix}} - suffix (set as an option in a permission plugin), {{name}} - real name, {{displayname}} - display name prefix="{{prefix:s}}{{displayname}}{{suffix}}&f: " # Sets the suffix to a message. {{prefix}} - prefix (set as an option in a permission plugin), {{suffix}} - suffix (set as an option in a permission plugin), {{name}} - real name, {{displayname}} - display name suffix="" } # Group templates override the default chat template based on the users group. Note that the group name is case sensitive. # Weight matters, the player will use the highest weighted template in this list that matches a group they are in, including inherited groups. If the same weight is used on two or more entries, the group with the most parents will be used. group-templates { DefaultTemplate { # The default colour for a player's chat if the "chatcolour" permission option isn't set on the player or group. Takes the same input as the "namecolour" option set to "" to retain default behaviour (no change of colour). Do not include the "&" character. default-chatcolour="" # The default styles for a player's chat if the "chatstyle" permission option isn't set on the player or group. Takes the same input as the "chatstyle" option set to "" to retain default behaviour (no style). Do not include the "&" character. Multiple styles must be separated by commas. default-chatstyle="" # The default colour for a player's name if the "namecolour" permission option isn't set on the player or group. Takes the same input as the "chatcolour" option set to "" to retain default behaviour (no change of colour). Do not include the "&" character. default-namecolour="" # The default styles for a player's name if the "namestyle" permission option isn't set on the player or group. Takes the same input as the "namestyle" option, set to "" to retain default behaviour (no style). Do not include the "&" character. Multiple styles must be separated by commas. default-namestyle="" # Sets the prefix to a message. {{prefix}} - prefix (set as an option in a permission plugin), {{suffix}} - suffix (set as an option in a permission plugin), {{name}} - real name, {{displayname}} - display name prefix="{{prefix:s}}{{displayname}}{{suffix}}&f: " # Sets the suffix to a message. {{prefix}} - prefix (set as an option in a permission plugin), {{suffix}} - suffix (set as an option in a permission plugin), {{name}} - real name, {{displayname}} - display name suffix="" } } # If "true", then Nucleus will select the a group template for a player when they send a chat message, based on what isreturned by the "nucleus.chat.group" permission option. If it's false the default template will always be used. use-group-templates=true } # If true, Nucleus tries to remove the minecraft name prefix (<name>). try-to-remove-minecraft-prefix=true