Code:
on death of player:
if attacker is a player:
if player's max health is more than 1:
if the max health of attacker >= 30:
send "&c&lYou been killed by %attacker% and lost a heart" to victim
subtract 1 from max health of player
send "&cyou have the max hearts" to attacker
wait 2 ticks
if the max health of player <= 2:
send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
wait 1 tick
ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"
else:
add 1 to max health of attacker
send "&c&lYou been killed by %attacker% and lost a heart" to victim
subtract 1 from max health of player
wait 2 ticks
if the max health of player <= 0.5:
send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
wait 1 tick
ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"
else:
subtract 1 from max health of player
wait 2 ticks
if the max health of player <= 0.5:
send "&8[&bLifesteal&8] &cYou eliminated %player%" to attacker
broadcast "&8[&bLifesteal&8] &c%player% was ELIMINATED by %attacker%!"
wait 1 tick
ban player due to "&8[&bLifesteal&8] &cYou were ELIMINATED by %attacker%!" for 1 day
kick player due to "&8[&bLifesteal&8] &cYou have been ELIMINATED by %attacker%!"
command /withdraw:
trigger:
if the max health of player >= 2:
give player 1 of red dye named "&c♥♥♥HEART♥♥♥"
subtract 1 from max health of player
else:
send "&cYou dont have the amount of hearts needed to withdraw this"
on right click with red dye:
if name of player's tool is "&c♥♥♥HEART♥♥♥":
if the max health of player >= 30:
send "&cSorry but you have the max amount of hearts"
remove 1 red dye named "&c♥♥♥HEART♥♥♥" from player
else:
add 1 to max health of player
send "&aYou redeemed a heart"
remove 1 red dye named "&c♥♥♥HEART♥♥♥" from player
on load:
set {_heart} to red dye named "&c♥♥♥HEART♥♥♥"
register new shaped recipe for {_heart} named "&c♥♥♥HEART♥♥♥" using emerald block, diamond block, emerald block, diamond block, totem of undying, diamond block, emerald block, diamond block and emerald block with id "heart"