Skip to content

Latest commit

 

History

History
175 lines (154 loc) · 9.06 KB

cmi-custom-joinleave.md

File metadata and controls

175 lines (154 loc) · 9.06 KB

FAQ - How do I configure CMI for custom (first) join / leave messages?

FAQ Menu

CMI and Bungeecord info-, • Chance example, • CMI Chat manager, • Chat format info, • Chat filter, • Chat rooms, • CMI Commands info, • Custom Join and Leave, • CMI Economy manager, • Event commands, • Extending commands, • Getting started with CMI, • Glow info, • Create custom /help, • CMI Hex colors, • Importing data into CMI, • CMILib library info, • Customizing CMI Locale, • CMI Chat with LuckPerms prefix, • Migrate to MySQL database, • Player stuck in Mode?, • User-moderation info, • More message commands, • MOTD, • Parameters explained, • Ranks info, • Create custom /rules, • Running CMI, • Safety tips, • Specialized commands info, • Toggle example, • Trash example, • CMI Vote manager, • Worth info.

Official Zrips Links
  • Zrips Website
    https://www.zrips.net/
    The official website, wiki/documentation/information
  • Zrips Discord
    https://discord.gg/dDMamN4
    The official Discord community server with member-driven support
  • Zrips Github
    https://github.com/Zrips
    The place for bug reports and feature suggestions
Prerequisites
  • Buy and Download CMI (premium plugin)
    https://www.spigotmc.org/resources/3742/
    Get the CMI plugin if you haven't already, and then install it on all your servers
  • Also Download CMILib (free library) (more info)
    https://www.spigotmc.org/resources/87610/
    All Zrips plugins require the CMILib .jar file. Get it and also put it on all your servers.
  • All my FAQ pages have been written for Spigot / Paper 1.20.x and CMI 9.6.x.x or newer.
  • The mrfdev Github page is not an official resource, we're building up our knowledge base as a courtesy.
  • I am an admin on the Zrips Discord, this does not mean what I share on here is official.

Turn on and display a custom join and leave messages to players.


ℹ️ CMI Chat + Custom Join/Leave messages

  • Start using CMI as Chat Manager, if you were using something else.
  • Update config.yml (see below)
Messages:
  Login:
    # If set to true, login message wont be shown
    Disabled: false
    # Defines number of players from which to automatically start hiding join messages
    # Set to -1 to disable this
    AutoHideFrom: -1
    Custom:
      # If set to true, custom login message will be used. cmi.messages.disablelogin can be used to disable message for player
      Use: true
  Logout:
    # If set to true, logout message wont be shown
    Disabled: false
    # Defines number of players from which to automatically start hiding logout messages
    # Set to -1 to disable this
    AutoHideFrom: -1
    Custom:
      # If set to true, custom logout message will be used. cmi.messages.disablequit can be used to disable message for player
      Use: true
  # Check locale file for translation and custom placeholders: [playername], [totalUsers], [onlinePlayers]
  FirstJoinMessage:
    Use: true
  DeathMessage:
    # Defines number of players from which to automatically start hiding death messages
    # Set to -1 to disable this
    AutoHideFrom: -1

Note: If you are still on an outdated version below 9.0.7.x, the directory will be ~/plugins/CMILib/Translations.

Next, inside the ~/plugins/CMI/Translations/ directory there is at least the file Locale_EN.yml, where you can find:

Chat:
  localPrefix: ''
  shoutPrefix: '&c[S]&r'
  LocalNoOne: '!actionbar!&cNobody hear you, write ! before message for global chat'
  shoutDeduction: '!actionbar!&cDeducted &e[amount] &cfor shout'
  # Use \n to add new line
  publicHover: '&eSent time: &6%server_time_hh:mm:ss%'
  privateHover: '&eSent time: &6%server_time_hh:mm:ss%'
  staffHover: '&eSent time: &6%server_time_hh:mm:ss%'
  helpopHover: '&eSent time: &6%server_time_hh:mm:ss%'
  link: '&l&4[&7LINK&4]'
  item: '&7[%cmi_iteminhand_realname%[amount]&7]'
  itemAmount: ' x[amount]'
  itemEmpty: '&7[Mighty fist]'

And below is an example of some basic text you could use / customize:

  FirstJoin: '{#Cerulean} 1MB Server »{#Feijoa} Welcome new player &6[playerDisplayName]{#Feijoa}
    to 1MoreBlock.com!'
  LogoutCustom: '{#Cerulean} - {#Feijoa}Player &l[playerDisplayName]&r {#Feijoa}left.'
  LoginCustom: '{#Cerulean} 1MB Server »{#Feijoa} Welcome back &6[playerDisplayName]
    {#Feijoa}❤'

As you can see you can use certain variables, CMI's hex colors, and set the text to whatever you want. Note that the above is a customization and not the default text, but gives you the info to search for within the locale file.

ℹ️ Other Languages

Of course, if you use another language you will have to adjust that file. They are also in the translations/ directory.

ℹ️ Hiding certain Groups/Players

If you wish to hide the join/leave messages for a certain group or user, you can use these permissions:

> cmi checkperm disable

  cmi.messages.disablelogin - Disables login message
  cmi.messages.disablequit - Disables logout message
  • LuckPerm: lp group owner permission set cmi.messages.disablejoin true
  • LuckPerm: lp user mrfloris permission set cmi.messages.disablequit true

ℹ️ Extending CMI Join Events

If you want to give first-time players something extra, you can utilise the /Settings/EventCommands.yml file at the onfirstjoin and onjoin sections: (for example, you can make another .txt file, run certain commands, or do whatever)

firstJoinServer:
  Enabled: true
  Commands:
  - msg! [playerName] This is event command example!
..etc..

ℹ️ Switching (Bungee) Servers

In the ~/plugins/CMI/Translations/ folder, the locale_EN.yml file has the following, which you can customize:

  ServerSwitchOut: ' &6[playerDisplayName] &eswitched server to &6[serverName]'
  ServerSwitchIn: ' &6[playerDisplayName] &ecame from &6[serverName] &eserver'