Solved Armour-Ignoring Damage

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

inavir

Member
May 1, 2017
10
0
0
Hello, I was looking to set the damage in a on damage event to a value which ignores armour. To give you an example of what I was looking to do, the following code should explain.

code_language.skript:
on damage:
    set {_damage} to 10
    set damage to 0
    set victim's health to victim's health - ({_damage} / 2)

However, doing this doesn't show the death message properly if a player kills another player, and generally just messes with other plugins I'm using.

From what I've seen, Tuske's damage modifier expression might have helped, but it seems it was removed in 1.12. Furthermore, the final damage expression can't be set to anything. Is there any way around this aside from editing the nbt of the victim's armour every time?
 
To make it properly register the player as the killer, you can detect
code_language.skript:
if final damage > victim's max health
and, if so, set their health to some incredibly low number like 0.01 so that they'll still die via the attacker's damage, and then otherwise (if they're not gonna get killed by the damage) you can just keep doing what you're doing (subtracting the damage from their health directly).

Otherwise, no, there isn't a great way to do it as far as I'm aware.
 
Status
Not open for further replies.