fake player combat system

i want to simulate player combat, this means i need to detect when a player hurts another player and get the exact damage they have been dealt, store the last hitter, etc.. without actually killing players (so after being hurt i will apply the instant health effect) im on v 1.21.7
Continue to help post