DeathPenalty - A better keepInventory


#1

Edit: I just realized how inappropriate the name is, I may change it in the next update.

DeathPenalty[API v4]


Download

Source

Description

This plugin helps you to punish players who kill themselves on purpose. It is very attractive for servers with keepInventory gamerule enabled. Maybe the players want to fill up their hunger bar? Maybe they want to be teleported to their spawn? Who knows...
This plugin is the solution! Currently there are three types to punish a player: Reducing the xp, reducing the money and giving them potion effects.

Requirements

  • An economy plugin. You don't have to have one when the moneyReduction in the config equals 0 or 0%.

Config

Generated at startup. This is an example config:

# Whether it should be logged to the console when someone dies.
logDeath=true
# Relative or fixed => with or without percent sign
moneyReduction="250"
# Relative or fixed => with or without percent sign
xpReduction="70%"
# Potion effects applied at death. You can do 'copy & paste' to add new effects.
potionEffects=[
    {
        amplifier=2
        # Duration in seconds
        duration=180
        id=slowness
        showParticles=false
    },
    {
        amplifier=1
        # Duration in seconds
        duration=180
        id=nausea
        showParticles=false
    }
]

# Ways to die when this plugin should NOT take any action.
deathTypes {
    pvp=true
}

...(Cut off the death message configs)...

# Don't modify this value! It is for internal use.
recentlyDiedPlayers=[]

moneyReduction or xpReduction equal 0 or 0% are ignored!


Suggestions are welcome!

RandomByte


Death Penalty
Graveyards - A player spawn-point plugin
DeathPenalty - Withdraw bank account on death
Timed potion effect on respawn for debuff api 5?
#2

Awesome! Thanks for this. Will definitely check it out as soon as I can

Edit: so uhh @RandomByte the config file didn't generate on startup

Other stuff works such as exp and blindness but the money portion doesn't work with totaleconomy


#3

This is good for Skyblock as well. Youve churned out a lot of plugins for Sponge @RandomByte ! Much appreciated.


#4

@Joe_Schmo2840 Thanks! More good things are coming :wink:
@SnowBlitzz When someone dies the config will be generated. What files and folders are in your config folder? Does my plugin say anything about "can't do financial thing because no economy"? The config defaults to not reduce money.


#5

Ah ok it generated when I drowned myself. I thought the default money multiplier was 0.9 which turned out to be 1. I've changed that and I guess its working now, thanks! However it sends 2 blank lines when I die, I assume messages are supposed to go there telling players about the penalty? Is that gonna be a feature soon? :smiley:


#6

The example config in the first post isn't the default one. Sorry for the inconvenience. Also I have to change the default money multiplier to below zero to avoid error messages when no economy plugin is installed.
The two lines shouldn't appear. I am very sure that it isn't this plugin. The only messages it writes is "initialized", "reloaded"(will be removed soon as the plugin doesn't need a reload) and "no economy plugin". Maybe it is your economy plugin? To test it, set the money multiplier below zero and the lines shouldn't appear.
And I'll add that on server start up the config will be generated.

Do you want a "penalty executed message"?


#7

Yeah penalty messages seem nice, there are 2 blank lines after you die which I'm not sure why but it's weird XD also how about an option for fixed amount of money reduction instead of multiplier?


#8

v0.2.0 released!


The changelog is at the above linked page.


#9

Great update :smiley:

  1. I see the plan to add the message wasn't considered or is still being worked on? Anyway I'd like to suggest for a whitelist for types of deaths that won't be affected by the plugin such as death by pvp (?)

  2. The whole point of this plugin is to punish players who kill themselves on purpose to regain health or hunger on servers with keepInventory enabled. How about a feature to have their hunger be the same as when they killed themselves? This forces them to eat if they want to regain hunger.


#10

Thanks!

  1. I thought you wanted logging deaths to the server console?! I can easily change the behavior to your needs. So please describe this further with few examples. :slight_smile:
    Whitelist, okay. I put there some death types that can be enabled or disabled.

  2. There are two ways to deal with the general problem of suicide to regenerate the hunger bar: 1. Punish for suicide or 2. take the benefits of suicide away. I prefer the way this plugin works because it covers other reasons of suicide like to be teleprted to the spawn.
    For "taking away the benefits" I think about creating a plugin just for that.


#11

Cool :smiley:

  1. When someone dies the server will send them a message that only they can see, for example [DeathPenalty] Dying will result in you losing 50% of your exp and $100, try to survive next time! You can buy food at blah3. Customizable message would be nice.

  2. Config option to enable/disable death types will be awesome :wink:

  3. Most servers would have /spawn available to everyone though, but yeah you have a point. Thought I think having them keep the same hunger bar before they killed themselves would make them think suicide isn't helping them regenerate it so they're forced to buy food. A separate plugin makes sense but ripping off their benefits from suicide kinda also falls under death penalty.


#12

v0.3.0 released!


The changelog is at the above linked page.


#13

v0.3.1 released!


The changelog is at the above linked page.


#14

pvp is still affected by the penalty although it's whitelisted


#15

Thanks for the report, I'll look into this when I have time.


#16

v0.3.2 released!


The changelog can be found at the above linked page.

@SnowBlitzz I hope it is fixed now :slight_smile:


#17

v1.0 released!

The changelog is on the above linked page.


#18

Awesome! Glad it has API 5 support now


#19

v1.1 released!

The changelog can be found at the download page.


I just realized how inappropriate the plugin name is...


#20

Thank you for making this plugin. Would you possible be able to update this plugin? Maybe add some features like :
Remove part of their inventory (based on %) if they die
Damage items if they die based on %

let me know what you think about these ideas :slight_smile: