The magnetic cabinet locks linked below are great except after dropping the key too many times the plastic shell cracked leaving us with only the magnet inside.
Print the top and bottom pieces without support, insert the magnet from the original key, and super glue the halves together.
The author marked this model as their own original creation.