SilverstoneMC / ExpensiveDeaths

Take money from people's balances when they die!
https://modrinth.com/plugin/expensivedeaths
GNU General Public License v3.0
2 stars 2 forks source link

Commands on respawn and death #2

Closed TheGoofBall64 closed 1 year ago

TheGoofBall64 commented 1 year ago

Description of the bug

Adding a command doesnt make it happen when you respawn, the command happens at the moment of death. While this could be useful for many, and probably in most cases I assume people would use it this way. Adding an option to have the command happen the moment of respawn would also be nice (and also considering you added it specifically because I asked, and you told me to put this here :P ).

Link to latest.log file

https://paste.gg/p/anonymous/62d2580d64d947859c5de9662a95b841

Steps to reproduce the problem

Put a command, such as a give command, into the player commands death spot in the config. die. it gives it to you the moment of death not respawn. So the items get left at your body or don't get given at all (essentials announces the kit was given though, so the command works), probably because the command ran while the player was dead.

  # Commands run by the player when they die
  player-commands:
   - "/kit death"

Expected behavior

The player gets the kit "death" upon respawn

Output of /version

[22:15:49 INFO]: Checking version, please wait... [22:15:50 INFO]: This server is running Paper version git-Paper-420 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: 81d7ff6) You are 6 version(s) behind Download the new version at: https://papermc.io/downloads

Output of /version ExpensiveDeaths

[22:11:28 INFO]: ExpensiveDeaths version 1.1.4 [22:11:28 INFO]: Clear someone's balance when they die [22:11:28 INFO]: Website: https://github.com/SilverstoneMC/ExpensiveDeaths [22:11:28 INFO]: Author: JasonHorkles

ExpensiveDeaths config.yml

# Set the message to "" to disable it

# Use {MONEY} to display the money they lost

# Use {BALANCE} to display the player's remaining balance

death-message: ""

bypass-message: ""

# How much should we take from the player when they die?

# Valid options are:

# amount-to-take: 15% - takes 15% of their balance

# amount-to-take: 0-15% - takes random amount between 0-15% of their balance

# amount-to-take: ALL - resets their balance to 0

# amount-to-take: 100.00 - takes $100 from their balance

amount-to-take: 00.0

# The format to use for displaying currencies

# The current format is used by most countries and likely doesn't need touched

currency-format: "#,##0.00"

# The format to use for currency symbols

# For 1,234.50 use US

# For 1.234,50 use DE

# For 1'234,50 use CH

# Or see https://www.iso.org/obp for all Alpha-2 country codes

currency-country: US

# Additional features not related to economy

bonus:

  # Use {PLAYER} for the player

  # Use {DISPLAYNAME} for the player's display name

  # Commands run by console when a player dies

  console-commands:

   - ""

   - ""

  #- "command 1"

  #- "command 2"

  # Commands run by the player when they die

  player-commands:

   - "/kit death"

  #- "command 1"

  #- "command 2"

Additional info

Minecraft is fun

TheGoofBall64 commented 1 year ago

The respawn commands still dont work. They activate upon respawn, and essentials announces in chat the kit was given. But I assume its trying to give me the kit on the same tick I clicked respawn. effectively giving a player that for technically for a tick or two doesn't have an inventory yet.

Im suggesting adding a few tick delay to the respawn command

JasonHorkles commented 1 year ago

Try this ExpensiveDeaths.zip

TheGoofBall64 commented 1 year ago

Works