If at the moment of attack on you (if you fall on thorns, fall on a spiked ball, or someone hits you, etc.) you change the character, then for about a third of a second you will become immortal and there will be no damage.
There are platforms that are pressed against the wall when standing on them. If you put a bar or something else on such a platform, it will not react to characters standing on this object. You can stand as long as you like.