Sueta
DE

DeathTax

1.0.1

Death and Taxes; An ideal combination to make your economy server more competitive.

·Plugin

Next release v1.0.2 on Nov. 20th - Dec. 5th.
/!\ Code optimization in progress... /!\ (0%)
Happy Thanksgiving!
(Nov. 28 is my birthday. I will be 22 years old.)

This resource needs a logo! Please submit your designs in a PM to LegendDoubleB.

Motivate me to keep learning by donating today!
Donate via PayPal

Preface
I started this project to learn java with the Spigot API since I love Minecraft so much. There may be bugs when using this resource. I will attempt to fix any problems so I can keep learning how to code more effectively. Use this plugin at your own risk. Thank you.

Introduction

Is your server economy over-inflated and players frequently die or kill themselves without any consequences? Introducing DeathTax; the plugin that will help with economy inflation by taxing players whenever they die. This plugin can also give a victim's killer money from the loss of their victim. On the contrary, you can also levy a tax from the killer's earnings and/or take money from a killer for killing another player as a penalty.

How it Works

There are two different forms of death:
Environmental Death - A player dies without assistance from another player or dies from self-inflicted injury. (PvE)

PVE Examples
  • Hostile Mobs, drowning, suffocation, self-harm, lava, fire, lightning, fall damage, redstone traps, void damage, commands, etc...

Combat Death - A player dies because of another player's actions. (PvP)

PVP Examples
  • TNT, potions/throwables, any weapon, and inflicting damage indirectly (fall damage, lava, lingering potions, Thorn enchantment, etc...).

The plugin will detect how a player dies (using PlayerDeathEvent) and based on the settings in the configuration, will handle the player's money accordingly.

Your players keep dying, thus losing money and making the server more competitive while also influencing player combat.

*Ideal for: Role-Playing and Economy Based Servers*

Below are some scenarios with explanations:

Example One

A player falls off of a cliff and dies. This is an environmental death. They had $350. They lost $35 plus an additional 12%. They will respawn with $273. They lost a total of $77.
The configuration would look like this:

Configuration Example 1
# Section for death-by-environment taxation. (PvE)
death_by_pve:

    # The amount of money lost on death.
    base_fee: 35

    # Percentage of money lost on death.
    percentage: 12

This is what the debug would show in the console:

Example One Debug

Example Two

Two players are fighting each other. Player One is at the edge of a ravine. Player Two knocks Player One into the ravine by hitting them. Player One then dies from fall damage. This is a combat death. Why? Because Player Two caused Player One to die from fall damage.
Player One had $176.25. They lost $15 plus an additional 7%, which equals $27.32. They respawn with $148.93.
Player Two is awarded $10 plus an additional 25% from the victim's loss of $27.32, giving Player Two $16.83. Then Player two is taxed 75% from their earnings of $16.83, which equals $12.62. Player Two is left with $4.21 as a profit.

The configuration would look like this:

Configuration Example Two
# Section for death-by-player taxation. (PvP)
death_by_pvp:

    # The amount of money the victim loses.
    base_fee: 15

    # Percentage of money the victim loses.
    percentage: 7

    # The amount of money given to killer from lost money of victim.
    killer_gain_base_allowance: 10

    # Percentage of money given to killer from lost money of victim.
    killer_gain_percentage: 25

    # The amount of money that is taxed from the killer's earnings.
    killer_tax_base_fee: 0

    # Percentage of money that is taxed from the killer's earnings.
    killer_tax_percentage: 75


Overview

(In progress)

Debug

There is a debug feature (since v1.0.1) that will help users to understand how the plugin works by showing messages in the console whenever plugin related events occur. To use this, you must have "debug" set to true in config.yml.
Here are some example photos with explanations:

Plugin enabled!

When the plugin is successfully enabled. It will show you three main things:

Plugin enabled!

1.) The Vault plugin version that the server is using.
2.) The economy plugin that Vault is using.
3.) How much time it took the plugin to be enabled. (in milliseconds or seconds).

No Vault detected!

When there is no Vault plugin enabled, the plugin will disable itself, regardless of the economy plugin. This message also ignores the debug setting.

No economy plugin detected!

When Vault does not detect an economy plugin, the plugin will disable itself. This message ignores the debug setting.

Old file version detected!

When the file version is changed, the plugin will attempt to make a backup file. This message ignores the debug setting.

If the backup file with the same name already exists, this will appear:


Features

* Tax players for dying by means of PvP or PvE.
* Give a configured amount of the victim's money to their killer.
* Tax a killer a portion of their earnings.
* Penalize a killer for killing another player.
* Configure taxes to have a range limit.
* Disable worlds you do not want players to be taxed in.
* Ability to customize messages and add additional languages.
* Reload the configuration files from in-game.

Dependencies


Vault - Permission, Economy and Chat API

And any economy plugin that uses Vault.

Installation
1.) Download DeathTax by clicking on the "Download Now" button.
2.) Download Vault.
3.) Download an economy plugin that is compatible with Vault.(A list of plugins can be found on the Vault plugin page)
4.) Place all three files into your server's plugins folder.
5.) Start your server and configure to your liking!

Reminder: After step five, you can type "/deathtax reload" either in-game or from the console to reload the changes you made. Also, if you delete the configuration files, the reload command will regenerate them. No need to restart the server!
Warning: If you change the version text in any configuration file, the plugin will create a backup of that file, renaming it with the new version. Then it will restore the default configuration. If a backup file with the same file name exists, the plugin will write over the existing copy and restore the default configuration. However, if you remove the version section or its contents, the plugin will not create a backup file. Instead, it will delete the file and restore the default config.

Configuration

I have added comments to detail everything as much as possible. If there is something that you do not understand, please ask in the Discussion page.

Config.yml
# ♦──────────────────────────────────♦
# │ DeathTax - Plugin Configuration  │
# │ Author: TechnoRunner18           │
# │ Version 1.0.1                    │
# │ LegendDoubleB @SpigotMC.org      │
# ♦──────────────────────────────────♦



# DO NOT EDIT THIS VALUE! The plugin will create a backup of this file if you decide to update the plugin.
# If you do, once the plugin is reloaded, it will create a backup file with this version name, then restore the default config.
# If a backup file with the same file name exists, the plugin will write over the existing copy and restore the default config.
# If this value is empty, it will delete the config, then restore the default config.
version: 1.0.1

# Language localization.
# Available languages: en, es
# You can customize any message and add more languages in messages.yml.
# Please submit more translations!
language: en

# Do you want to show detailed messages in the console?
debug: false

# Would you like the plugin to check for updates?
update-check: true

# NOTE: All numbers must be positive. Set to 0 to disable.
# To have a range of numbers, insert a hyphen "-" inbetween two numbers. The number will be picked at random.
# (Ex. base_fee: 5-10)

# Section for death-by-environment taxation. (PvE)
death_by_pve:

    # Enable the death-by-environment tax?
    enabled: false
  
    # PvE will not have any effect in these worlds.
    disabledWorlds:
#   - world
#   - world_nether
#   - world_the_end

    # The amount of money lost on death.
    base_fee: 0
  
    # Percentage of money lost on death.
    percentage: 0
  
# Section for death-by-player taxation. (PvP)
death_by_pvp:

    # Enable the death-by-player tax?
    enabled: false
  
    # PvP will not have any effect in these worlds.
    disabledWorlds:
#   - world
#   - world_nether
#   - world_the_end

    # The amount of money the victim loses.
    base_fee: 0
  
    # Percentage of money the victim loses.
    percentage: 0
  
    # The amount of money given to killer from lost money of victim.
    killer_gain_base_allowance: 0
  
    # Percentage of money given to killer from lost money of victim.
    killer_gain_percentage: 0
  
    # The amount of money that is taxed from the killer's earnings.
    killer_tax_base_fee: 0
  
    # Percentage of money that is taxed from the killer's earnings.
    killer_tax_percentage: 0
  
    # The base amount of money to take from the killer's balance as a penalty after taxes.
    killer_penalty_base_fee: 0
  
    # Percentage of the killer's balance to take as a penalty after taxes.
    killer_penalty_percentage: 0
  

  
# ♦───────────────────♦
# │  DeathTax v1.0.1  │
# │   End of Config   │
# │   - Thank You -   │
# ♦───────────────────♦

Messages

All messages here are fully configurable. I added comments to detail what each message is intended for.
To demonstrate how to add more languages/custom messages, I tried to translate the english section into spanish(Espanol). This translation is not official and if there are any translation discrepancies, I apologize.
If you want to submit a translation for this plugin, please send LegendDoubleB a PM here on SpigotMC. Again, if there is something that you do not understand, please ask in the Discussion page

Similar projects

Plugin →