let hitMap = {}

EntityEvents.hurt(event => {
  const entity = event.entity
  const source = event.source

  if (!source.isProjectile()) return

  const id = entity.id

  if (!hitMap[id]) hitMap[id] = 0

  hitMap[id]++

  // só bloqueia spam absurdo (não dano alto)
  if (hitMap[id] > 15) {
    event.cancel()
  }

  setTimeout(() => {
    hitMap[id] = 0
  }, 50)
})