AvengerDCFan13_YT

Leech Skript

Aug 15th, 2025 (edited)
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.92 KB | None | 0 0
  1. # =========================================
  2. # Leech Enchant Skript
  3. # =========================================
  4. # Requires: Fox Enchant Creator plugin
  5. # Credits:
  6. # Code - AvengerDCFan13
  7. # Formula for Leech - LisooYT
  8. # Developers for Fox Enchant Creator - Fox Studios
  9. # YouTube: https://www.youtube.com/@AvengerDCFan13
  10. # Modrinth: https://modrinth.com/organization/foxstudios
  11. # =========================================
  12.  
  13. on load:
  14.    send "&aLeech Skript loaded Successfully."
  15.     send "&cThis Skript requires the &6Fox Enchant Creator &cplugin to work!"
  16.     send "&aCredits to https://modrinth.com/organization/foxstudios and https://www.youtube.com/@AvengerDCFan13"
  17.  
  18. options:
  19.     prefix: "&8[&4Leech&8]"
  20.  
  21. # ================================
  22. # Event: When an entity takes damage
  23. # ================================
  24. on damage:
  25.     if attacker is a player: # Only works for player attackers
  26.         if attacker's tool is enchanted with fec:leech:
  27.            set {_level} to level of fec:leech on attacker's tool
  28.             # Heal formula: (damage / 20) * (0.9 + (level / 10))
  29.             set {_heal} to (damage / 20) * (0.9 + ({_level} / 10))
  30.             heal attacker by {_heal}
  31.             # Check if notifications are enabled for this attacker
  32.             if {enableNotifyHeal::%uuid of attacker%} is set:
  33.                 send "%{@prefix}% &cYou have been healed by &a%{_heal}%&c." to attacker
  34.  
  35. # =================================
  36. # Command: /notifyheal
  37. # Toggles heal notifications
  38. # =================================
  39. command /notifyheal:
  40.     trigger:
  41.        if {enableNotifyHeal::%uuid of player%} is set:
  42.             clear {enableNotifyHeal::%uuid of player%}
  43.             send "%{@prefix}% &cYou are no longer being notified when using Leech." to player
  44.         else:
  45.            set {enableNotifyHeal::%uuid of player%} to true
  46.             send "%{@prefix}% &4You are now being notified when using Leech." to player
  47.  
Tags: Skript
Advertisement
Add Comment
Please, Sign In to add comment