Headshot Monitor:
type: world
+ debug: false
events:
on entity damaged by arrow:
- ^if <context.damager.is_player> {
- ^if <context.projectile.location.y> >= <context.entity.eye_location.y.sub[0.05]> && <context.projectile.location.y> <= <context.entity.eye_location.y.add[0.70]> {
- ^playeffect <context.entity.eye_location> effect:CRIT qty:5 offset:0.3 data:0.4
- ^if <context.entity.equipment.helmet||i@air> == i@air {
- - ^narrate t:<context.damager> "<&f><&l>Headshot! <&a>(+<context.damage.mul[1.25].sub[<context.damage>].as_int> damage)"
+ - ^execute as_server "tm amsg <context.damager.as_player.name> &f&lHeadshot! &a(+<context.damage.mul[1.25].sub[<context.damage>].as_int> damage)"
- ^determine <context.damage.mul[1.25]>
} else {
- - ^narrate t:<context.damager> "<&f><&l>Headshot! <&e>(+<context.damage.mul[1.15].sub[<context.damage>].as_int> damage)"
+ - ^execute as_server "tm amsg <context.damager.as_player.name> &f&lHeadshot! &e(+<context.damage.mul[1.15].sub[<context.damage>].as_int> damage)"
- ^determine <context.damage.mul[1.15]>
}
}
}