SlimeeyYt/UniversalTotem ? reverse-engineered prompt

Reverse engineered prompt

Build me a Fabric mod for Minecraft 1.21.1 that makes any item in the player’s main hand work like a Totem of Undying when they are about to die.

If the player has a real totem in either hand, that should still take priority. If not, then the main hand item should save them, one item should be consumed, and the usual survival effects should happen, like setting health to 1, giving regeneration, absorption, fire resistance, clearing fire, and playing the normal totem sound and particles. The saved player should also see the floating activation animation use the actual item that got consumed, not a totem. Please make sure it does not work in creative or spectator mode, or for damage that would normally bypass totem protection. If you need to check current Fabric or Minecraft 1.21.1 docs online while doing it, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab