Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =========================================
- # Leech Enchant Skript
- # =========================================
- # Requires: Fox Enchant Creator plugin
- # Credits:
- # Code - AvengerDCFan13
- # Formula for Leech - LisooYT
- # Developers for Fox Enchant Creator - Fox Studios
- # YouTube: https://www.youtube.com/@AvengerDCFan13
- # Modrinth: https://modrinth.com/organization/foxstudios
- # =========================================
- on load:
- send "&aLeech Skript loaded Successfully."
- send "&cThis Skript requires the &6Fox Enchant Creator &cplugin to work!"
- send "&aCredits to https://modrinth.com/organization/foxstudios and https://www.youtube.com/@AvengerDCFan13"
- options:
- prefix: "&8[&4Leech&8]"
- # ================================
- # Event: When an entity takes damage
- # ================================
- on damage:
- if attacker is a player: # Only works for player attackers
- if attacker's tool is enchanted with fec:leech:
- set {_level} to level of fec:leech on attacker's tool
- # Heal formula: (damage / 20) * (0.9 + (level / 10))
- set {_heal} to (damage / 20) * (0.9 + ({_level} / 10))
- heal attacker by {_heal}
- # Check if notifications are enabled for this attacker
- if {enableNotifyHeal::%uuid of attacker%} is set:
- send "%{@prefix}% &cYou have been healed by &a%{_heal}%&c." to attacker
- # =================================
- # Command: /notifyheal
- # Toggles heal notifications
- # =================================
- command /notifyheal:
- trigger:
- if {enableNotifyHeal::%uuid of player%} is set:
- clear {enableNotifyHeal::%uuid of player%}
- send "%{@prefix}% &cYou are no longer being notified when using Leech." to player
- else:
- set {enableNotifyHeal::%uuid of player%} to true
- send "%{@prefix}% &4You are now being notified when using Leech." to player
Advertisement
Add Comment
Please, Sign In to add comment