Chat system
Config file
KingdomCraft has support for multiple chat channels. You can add, delete or change channels. Je kan deze in the chat.yml config file.
enabled: true
default-channel: 'public'
channels:
kingdom:
format: '&6[K]&a{prefix}{rank_prefix}&a{username}&a: &f{message}'
prefix: ''
clone-per-kingdom: true
public:
format: '&8[P]&7{prefix}{kingdom_prefix}{rank_prefix} &7{username} &8\u00BB &7{message}'
prefix: '!'
toggleable: false
range: 20
cooldown: 5
hkm:
format: '&6[HKM]&a{prefix}{kingdom_prefix}{rank_prefix}&a{username}&a: &f{message}'
prefix: '@'
restrict: 'read'
toggleable: trueRoot options
Enabled
enabled: trueYou can disable the use of multiple chat channels with this option. It is recommend that you install another chat plugin so you can still configure the chat format.
Default channel
default-channel: 'public'This changes the default channel for players without a kingdom. They don’t need to prefix their message with an activator symbol to talk in this channel.
Channel options
Format
format: '&6[K]&a{prefix}{rank_prefix}&a{username}&a: &f{message}'In the above example {prefix} and {message} are examples of placeholders. A placeholder will be replaced with other text in the game depending on the player. Here is a list of all placeholders provided by KingdomCraft.
You can also use legacy color codes like &7 (gray) or &b (bold). You can find a list of these here. Alternatively you can also use full RGB colors in the format of <#rrggbb>.
Prefix
prefix: '@'This is the activator symbol that you have to put in front of your message to talk in this channel. You can also put multiple characters here.
E.g. to send the message hello there in the public channel you have to send !hello there otherwise it will be sent to the kingdom channel.
Clone-per-kingdom
clone-per-kingdom: trueThis will create a different chat channel for each kingdom which only their members can access. All these channels will have the same configuration.
Kingdoms
kingdoms:
- Eltria
- Altiri
- EmpirionWith this option you can restrict which kingdoms have access to this channel. This can be useful if you have fixed alliances which require their own chat channel. You can also enter just a single kingdom.
Toggleable
toggleable: falseYou can enable or disable if this channel can be toggled through the command /k chatchannel <channel>.
Restrict
restrict: 'read'With this option you can restrict a channel so only players with the permission kingdom.chat.channel.CHANNELNAME can access this channel. You can set this option to:
read: You need the permission to read and talk in this channel.talk: You need the permission to talk in this channel. Everyone can read. (e.g. an announcement channel)
Range
range: 20With this option you can only see the messages of players that are within this distance of blocks.
Cooldown
cooldown: 5You can set a cooldown on this channel in seconds. You only sent another message if this time has passed since your last message.
You can bypess this restriction with the following permission: kingdom.chat.bypass.cooldown
Commands
Join a channel
Join a channel
/k chatchannel join <channel> | kingdom.chatchannel.join |
Leave a channel
Leave a channel
/k chatchannel leave <channel> | kingdom.chatchannel.leave |
Chat
With this command you can directly specify a channel to send the given message in. For example, moderators can use this command to sent a message to channels of another kingdom.
/k chat <channel> <message> | kingdom.chat |
/k chat <channel> <message> | kingdom.chat.other |
Default channel
By default you will always talk in the channel with an empty activator prefix. If you want to talk by default in a channel that requires an activator prefix you can use this command.
For example, by default you don’t need a prefix for the channel public and you need the prefix ! to talk in the channel kingdom. If you use this command like /k dc kingdom then no longer need a prefix to talk in the channel kingdom and you can talk in the channel public with the prefix !.
/k dc <channel> |
Disable channel
You can disable a channel for the whole server. Nobody will be able to talk in this channel anymore.
/k chatchannel disable <channel> | kingdom.chatchannel.disable |
Enable channel
You can enable a channel after it was disabled.
/k chatchannel enable <channel> | kingdom.chatchannel.enable |
Placeholders
The following placeholders can be used in the chat format. If you have premium you can use even more placeholders and also use these placeholders in other plugins (More info).
These placeholders are always in relation to the player that sends the message and their kingdom or rank.
Placeholder | Description |
|---|---|
username | Name of the player. |
kingdom | The display (displayname) of the player’s kingdom. |
kingdom_name | The name of the player’s kingdom. |
kingdom_prefix | The prefix of the player’s kingdom. |
kingdom_suffix | The suffix of the player’s kingdom. |
rank | The display (displayname) of the player’s rank. |
rank_name | The naam of the player’s rank. |
rank_prefix | The prefix of the player’s rank. |
rank_suffix | The suffix fo the player’s rank. |
DiscordSRV
The chat system of KingdomCraft supports DiscordSRV. However, you still need to setup a few things.
Config snippet of DiscordSRV:
Channels:
public: 0123456789
roleplay: 9876543210
kingdom-eltria: 6969696969On the left is the KingomCraft channel name, on the right is the Discord channel id. e.g. public: 0123456789.
All messages sent in minecraft to this channel will be sent to the corresponding discord channel, and all messages sent to the discord channel will also be sent to the kingdomcraft channel in-game.
NB. The setting clone-per-kingdom: true on channels means that each kingdom gets their own channel. Internally this channel will have the following name: <channelnaam>-<kingdomnaam>. If you want to link this channel to a Discord channel you need to use this name. (e.g. roleplay-eltria is the roleplay channel specifically for the kingdom eltria).