Creating a death penalty datapack.

Hi helper, First of all, my English skill is about 40%. I'm a beginner at datapack creation, and I somewhat understand how "scoreboard" works. I also know how to use the "effect" command for the most part, but I'm not very sure about the structure of a datapack. My idea is: when a player dies, the max HP should be reduced by half for 30 minutes, and half of the items in their inventory (including armor slots and hotbar) should be destroyed. Thanks every single helper there come to help. For the purpose of use. I'm using it for my personal Minecraft server, which I play with my four friends. It's just for fun, not for profit
Continue to help post