I'm recreating the totem of untying as a special item, this is the code right now:
The only thing that bothers me is the lack of the animation of the undying effect. Anyone know if it's possible to display this animation? Thanks!
[doublepost=1495261271,1494819572][/doublepost]I've solved this by doing the following:
This will change the hand item to a totem of undying, do the damage activating the totem, and the totem is gone 1 tick later with the item saved in the variable _undyhandtool getting back into place, and remove the lore from the boot, so it's a one use item just as the totem should be. It's so fast that you can't see, really works.
[doublepost=1495583677][/doublepost]Ok, im now having some trouble with this skript.
The problem is that sometimes the totem enchant is triggered but the totem isn't used.
The totem sometimes go into the hand of the player but the damage is not high enough to kill the player (false flag, or something like that).
I'll move back to the old system:
BUT, the problem is: In this case, it just works with players. When mobs try to kill you, the skript won't detect it.
Is there a bug with "the final damage" syntax on mobs?
Thanks!
code_language.skript:
on damage:
if boot of victim is diamond boots with lore "Undying":
if the final damage is bigger than the health of victim:
set victim's boots to victim's boots with lore ""
cancel event
set the victim's health to 1
remove all potion from victim
apply regeneration 2 to the victim for 40 seconds
apply absorption 2 to the victim for 5 seconds
The only thing that bothers me is the lack of the animation of the undying effect. Anyone know if it's possible to display this animation? Thanks!
[doublepost=1495261271,1494819572][/doublepost]I've solved this by doing the following:
code_language.skript:
on damage:
if lore of victim's boot is "Undying":
if the final damage is bigger than the health of victim:
set {_undyhandtool} to victim's tool
set tool of victim to totem of undying
set victim's boots to victim's boots with lore ""
wait 1 tick
set tool of victim to {_undyhandtool}
clear {_undyhandtool}
stop
This will change the hand item to a totem of undying, do the damage activating the totem, and the totem is gone 1 tick later with the item saved in the variable _undyhandtool getting back into place, and remove the lore from the boot, so it's a one use item just as the totem should be. It's so fast that you can't see, really works.
[doublepost=1495583677][/doublepost]Ok, im now having some trouble with this skript.
The problem is that sometimes the totem enchant is triggered but the totem isn't used.
The totem sometimes go into the hand of the player but the damage is not high enough to kill the player (false flag, or something like that).
I'll move back to the old system:
code_language.skript:
on damage:
if boot of victim is diamond boots with lore "Undying":
if the final damage is bigger than the health of victim:
set victim's boots to victim's boots with lore ""
cancel event
set the victim's health to 1
remove all potion from victim
apply regeneration 2 to the victim for 40 seconds
apply absorption 2 to the victim for 5 seconds
BUT, the problem is: In this case, it just works with players. When mobs try to kill you, the skript won't detect it.
Is there a bug with "the final damage" syntax on mobs?
Thanks!