When giving yourself high levels off the resistance effect in a singleplayer world, for example level 255, the effect works just fine, making you take no damage from most sources.
The effect is also shown in the inventory GUI.
If you now leave the game and then rejoin it, the effect is still shown in your inventory GUI, but no dammage is reduced.
Related issues
Comments


Thank you for your report!
We're tracking this issue in MC-10755, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Unsupported amplifier: MC-10755.
BTW, level 5 already makes you take no damage. It's 20% reduction per level.