[WIP] Chaton 3.0.0 - Customize your server chat

Chaton

Chaton is a plugin which allows server administrators to customize their chat.
You can change the join, leave and chat messages.

By default when you install it, it does nothing else than copying the vanilla behavior, but in the configuration,
you can change the behavior.

There is also a currupt option in the configuration if you want to make your chat a little
more realistic.

Configuration

In the configuration you have multiple sections, in the first one, you can change the join, leave and chat messages templates. You need to use the Minecraft JSON text format.

For example, letā€™s analyze this template:

templates {
    join {
        arguments {
            source {
                optional = false
            }
        }

        content {
            # Here is the Minecraft JSON format, you should only modify this
            # for the templates

            color = aqua
            text = "{source} "

            extra = [{
                # Sub text
                color = yellow
                text = "has joined the server!"
            }]
        }

        options {
            closeArg="}"
            openArg="{"
        }
    }
}

The ā€˜{source}ā€™ placeholder represents the source which joined the server with prefixes.
If you donā€™t understand you can ask me.

In the second and third section, you can configure prefixes depending on permissions. Letā€™s analyze this:

prefix {
    builder = {
       text = "[Builder] "
       color = dark_blue
    }

    admin = {
        text = "[Administrator] "
        color = dark_blue
    }
}

That means that the plugin will search if the player have the permission ā€˜chaton.prefixes.builderā€™, and the permission ā€˜chaton.prefixes.adminā€™, and it will concatenate all the prefixes the player have. For example, if the player has the two permissions, the message will be something like ā€˜[Builder] [Administrator] Advancidā€™ with colors instead of bold.

Then you can add some realism to your chat using the third option ā€˜corruptā€™, you can enable it, set the maximum distance for hearing, and the minimum distance to start corrupting the message depending on the distance. You can also choose the character it will use.

There is also a section named enabled which allows you to enable or not a feature
by tweaking the feature to true/false.

The next section is for the source, it works the same way as the prefixed but you have ā€˜{name}ā€™ for the source display name. This can be useful for example with prefixes if you want the color to continue in your display name.

source {
    builder {
        arguments {
            name {
                optional = false
            }
        }

        content {
            color = blue
            text = "{name}"
        }

        options {
            closeArg="}"
            openArg="{"
        }
    }

    admin {
        arguments {
            name {
                optional = false
            }
        }

        content {
            color = red
            text = "{name}"
        }

        options {
            closeArg="}"
            openArg="{"
        }
    }
}

Other plugins

Currently Chaton works with PermissionsEX prefixes and suffixes, but you should directly
use the plugin prefixes and suffixes since itā€™s more flexible. In PermissionEX, you canā€™t have multiple prefixes
depending on your groups.

Permissions

Here are the following plugin permissions which are self-explanatory:

  • chaton.action.message: Allows the player to speak in the chat
  • chaton.chat.colors: Allows the player to use colors in the chat using the ā€˜&ā€™ sign
  • chaton.prefixes.*: Defines the player prefixes
  • chaton.source.*: Defines the player source template
  • chaton.bypass.corrupt: Disables the corrupt effect (only useful if it is enabled in the configuration)

:arrow_down: Download latest

:octocat: Source on Github

:exclamation: Issues and Suggestions

If you have any suggestion or bug, please tell me on Github or on the forums.

Thank you! :wink:
This is my first Sponge plugin.

4 Likes

How does this work if you have PEX - does it overlap the prefix, or does it coexist? I like the idea of adding prefix/suffix through a permission node, but how does it work if you have more than one prefix or suffix?
Often, players can have multiple ranks, say Builder, Moderator and you can add their donator rank through a suffix, so would Builder or Moderator override one another, and vice versa for suffixes?

Hi! I think I found a bug regarding the variables.

When I use a variable in the config, the second % of the variable will also appear in the actual chat itself. Iā€™ve tried removing the second % from the config to see if it helped, but that just causes it to switch back to the old config that was using the second %. Iā€™ve included a screenshot below incase that helps!

Would it be possible to show the players displayname (nickname caused by the /nick command for example)?

Thanks!

@Rasgnarok

In my the new 2.0.0 it now supports PEX without overlapping the prefix.
You can also add multiple prefixes. Read the post above for more information.

1 Like

@ARCVDE

In the new version 2.0.0,
the plugin now uses the player display name instead of the name, and I fixed the bug you noticed.
I changed the configuration so it may be a little hard to upgrade if you donā€™t understand how Minecraft JSON format works.

1 Like

New version 2.0.1 which fixes a problem with PEX and an error in the Console.
There was duplicate prefixes/suffixes, and I made a typo in the code.

1 Like

Would be interesting to have a way to disable the different features - upon loading the plugin for the first time, it displayed all my PEX rankings, but since some are hereditary, they should not be showing up. Any way to circumvent this?

For example, my Admins are getting their perms from Builder/Mod, but Chaton right now is showing that they are [Admin] [Builder] [Moderator]ā€¦

@Rasgnarok

I fixed the error in the new version 2.0.2.
Also, you can use Chaton prefixes instead of using prefixes and suffixes from PermissionsEX as it is
simpler and you can have more than two prefixes.

Is there a way to make the features disabled? Since I am using EssentialsCmds, the login, logout message overlaps the one I had already in place. Same thing for determining the symbol that frames the playerā€™s name and rank.

@Rasgnarok

In the new version 2.1.0, you can disable features in the configuration.

1 Like

Something that would be very useful to add to this plugin: permission-based JSON formatting, like the prefix, but for the player name!

Is it possible to have the color of the prefix follow onto the username?

Sorry for being late.

Iā€™ve released the version 3.0.0 which adds a template for the source and remove the prefixes since
I think it makes the configuration harder, and I donā€™t think a lot of people uses this option.

@lasercar Done in the version 3.0.0.
@broro07 You can now use the source template, for example you could use a configuration like that:

prefix {
   founder {
      text = "[Founder] "
      color = dark_red
   }
}

source {
    founder {
        arguments {
            name {
                optional = false
            }
        }

        content {
            color = red
            text = "{name}"
        }

        options {
            closeArg="}"
            openArg="{"
        }
    }
}
1 Like

Can we not format our tags like so: Owner: &3[&bOwner&3]&r with this plugin?

If not, whats the chances of this being added? Adding this would simplify your config a bit as you wonā€™t need the very limited color=yellow that is currently used.

I need this feature for me to be able to use this plugin. I think your plugin is the only one offering multiple ranks which is the one thing Iā€™m after.

Hey! Keep up the good work! :heart:

The version of plugin is not version 3.0.0 but 2.1.0. I donā€™t know if it impact the plugin butā€¦ For me the plugin doesnā€™t work :confused:

Hello. I just made a fork for SpongeAPI 5 support.

This is an unofficial version of chaton and itā€™s not ā€œapprovedā€ by the original author. This is a MIT licensed project, so anyone can fork the original project and redistribute it.

I made a pull request so hopefully the original author will include my changes, or eventually work on another solution for supporting SpongeAPI 5.

PS: the ā€œv2.1.0ā€ you see is just a typo.

1 Like

Hello,

I have a problem. I use chaton to add a prefix and a color to the name. I use SimplePermission. I add prefix to the default group but the color of the name donā€™t work.

My config:

Can you help me ?

Can there be a command added to reload the config? That would save a lot of time :slight_smile:

What happened to this project? It was so good! :frowning:

If someone still wants to download this, you can find my fork here: https://github.com/KaiKikuchi/chaton