Menu

Death Group

Zathrus Writer

Death Group

This is an event handling function that will allow you to switch player into a predefined group upon their death. Furthermore, a command can be executed once the player dies to accommodate extended actions (like announcing the death, setting new spawn location etc).


Plugin dependencies

Death Group functionality require a permission plugin to be installed on your server (such as PermissionsEX), as the built-in Bukkit permission system does not support permission groups.

Since there are many permission plugins, it would be inefficient for CommandsEX to try and implement them all, as there already is a plugin that does exactly that. This plugin is called Vault and you will need to have it installed on your server for Death Group feature to work.


Configuration

There are 2 config options added to accommodate death player's group changing functionality:

  • deathGroupChanges - defines into which group to move a player once they die. An example configuration is provided below this text with further explanation.
  • deathGroupsCleanupTime - this sets time (in days) after which we delete old records of player groups from database. Every time a player dies, his previous group is stored in database, so they can switch back to it via command. For players that die and do not play on the server anymore, this time is used for cleanup purposes, so the database does not grow too large. Set to 0 to disable (not recommended). Default: 14

Configuration example:

deathGroupChanges:
    citizen:
        toGroup: default
        command: say &eAw, snap! &f$p &ehas just left the world of mortals and became a nameless wanderer again.

... this configuration will move each player of group citizen to group default upon their death. Furthermore, a /say command will be executed, announcing this player's death.

If you set up multiple group transitions, let's say one will be knight -> translucent and another one will be citizen -> default, the plugin will honor both group changes. First, it will remove knight and citizen groups for that player, then it will add translucent and default groups.

If a player is not part of any of these groups, simply nothing will happen for him.

Same principle works with /greset command, which is used to reset player's group back to what it was before they died. When used, this player will loose his translucent and default groups and will be assigned knight and citizen groups again.


/cex_greset

  • Description: Returns player whose group has been changed upon death to his previous group.
  • Usage: /cex_greset [Player]
  • Permission node: cex.deathgroup.reset
  • Default permission: OP only
  • Aliases: greset
  • Location in JAR file: com/github/zathrus_writer/commandsex/commands/Command_cex_greset.class

Special permissions

There was 1 special permission introduced to CommandsEX to accommodate Death Group functionality:

  • cex.deathgroup.ignore - Players with this permission don't get their group changed after they die.

How to remove this feature

Should there be a need to manually remove this feature from the JAR file, the following files must be removed:

com/github/zathrus_writer/commandsex/handlers/Handler_deathgroup.class
com/github/zathrus_writer/commandsex/commands/Command_cex_greset.class


Related

Wiki: CommandsEX CraftBukkit plugin Wiki

MongoDB Logo MongoDB