Entity - on Damage Section (Section) — Lusk

Addon: Lusk · Category: Section · Since: 1.1

Syntax

[execute|run] on damage of %~entity%

Description

Runs the code inside of it when the provided entity takes damage.

Local Variables that are: - defined BEFORE this section CAN be used inside of it. - defined AFTER this section CANNOT be used inside of it. - defined INSIDE this section CANNOT be used outside of it.

Examples

command /a:
  trigger:
    spawn pig at player:
      set display name of entity to "&dPig &7- &c%health of entity%&8/&c%max health of entity%"
      on damage of entity:
        set display name of victim to "&dPig &7- &c%health of victim - final damage%&8/&c%max health of victim%"

View source