#detecting that one player hurt another no longer works

1 messages · Page 1 of 1 (latest)

dreamy delta
#

I need help in fixing a function which now no longer works in 1.19.60 which is to detect the damage of an entity

world.events.entityHurt.subscribe(data => {
  const attacker = data.damagingEntity, hurt = data.hurtEntity;
  if (attacker.hasTag("l")) {
    time++;
    if (time == 1) {
      attacker.runCommandAsync(`tellraw @a[tag=staff] {"rawtext":[{"text":"§7[§dCombat§7] §d${attacker.name} §7esta en pvp con§d ${hurt.nameTag} §r"}]}`);
    }
    if (time == 3) {
      time = 0;
    }
  }
});
lusty talon
#

data.damageSource.damagingEntity

#

search up entityHurt, so u can see other's issue like this

dreamy delta
#

the hurt entity thing works perfectly, it was just the other one that didn't work for me

lusty talon
#

ik

midnight badge
dreamy delta
#

Ok thx baby