1. # ------------------------------------------------
  2. # | NO LAVA SUICIDE by Iron Wolf Network |
  3. # | Written by /u/NightWolf105 |
  4. # | Thanks to D4mnx for debugging |
  5. # | Thanks to Sitris for testing |
  6. # | http://ironwolfmc.net |
  7. # ------------------------------------------------
  8. command /deathchest <text="toggle">:
  9. description: Enable/Disable/Toggle
  10. usage: /deathchest [enable/disable/toggle] defaults to toggle
  11. permission: skript.op
  12. trigger:
  13. if arg 1 is "disable":
  14. set {deathchest} to false
  15. message "<orange>Death chest disabled!"
  16. else if arg 1 is "enable":
  17. set {deathchest} to true
  18. message "<orange>Death chest enabled!"
  19. else if arg 1 is "toggle":
  20. if {deathchest} is true:
  21. set {deathchest} to false
  22. message "<orange>Death chest disabled!"
  23. else:
  24. set {deathchest} to true
  25. message "<orange>Death chest enabled!"
  26.  
  27. on damage of player:
  28. if {deathchest} is true:
  29. if {pvptimer.%victim%} is 0:
  30. attacker is a player
  31. victim is a player
  32. set {pvptimer.%victim%} to 1
  33. wait 60 seconds
  34. set {pvptimer.%victim%} to 0
  35.  
  36. on death of player:
  37. if {pvptimer.%player%} is 1:
  38. damage was caused by lava, fire or burning:
  39. set {_tempinventory} to the player's inventory
  40. set {_templocation} to the block below the player
  41. set block 1 meter north of {_templocation} to Chest
  42. set block at {_templocation} to Chest
  43. set the inventory of the block at {_templocation} to {_tempinventory}
  44. clear drops
  45.  
  46. on player respawn:
  47. if {deathchest} is true:
  48. clear the player's inventory
  49. set {pvptimer.%player%} to 0