Board Thread:General Mod Discussion/@comment-116.87.0.247-20180221133318/@comment-31507215-20180221185247

It is a bit technical, but here is a way to reset alignment on death:
 * 1) Create a scoreboard objective. Its name should be "justDied", and its criterion should be "stat.deaths".  (It wouldn't need a display name because it would be hidden.)
 * 2) Somewhere in the spawn chunks, set up a redstone clock circuit. It should send out a pulse almost constantly, but not so fast as to cause much lag or burn out any redstone torches.  (Setting it up in the spawn chunks will allow it to pulse even when no-one is nearby, and should keep non-ops from tampering with it.)
 * 3) Connect a command block to the circuit. Make sure that there is a block between the redstone and the command block, so that the command block is powered, but nothing attached to the command block will be.
 * 4) Input the following command into the command block: "testfor @a[score_justDied_min=1]"
 * 5) Place a redstone comparator adjacent to the command block, so that it has its back to the command block.
 * 6) Place a redstone repeater on the opposite side of the comparator from the command block.
 * 7) Place three redstone dust so that they "T" off from the end of the repeater.
 * 8) Place a command block on one side of the redstone. Input the following command into it: "alignment set ALL 0  @a[score_justDied_min=1]"
 * 9) On the opposite side of the three redstone from the most recent command block, place a repeater and another command block.
 * 10) Input the following command into that command block: "scoreboard players set @a[score_justDied_min=1] justDied 0"

Theoretically, that will create an automated command sequence that will detect players who have died, reset their alignment, and then forget about them.