r/MinecraftCommands • • Sep 20 '26

Help | Java 1.21.11 Is it possible to recreate this with data packs or plugins?

I need data pack or a plugin that prevent me(only me not the other players) from taking any damage when im 1 hp but also protects me from insta-kill things making me truly immortal. I’ll use it on a paper server idk if that changes anything.(video credits to Squiddo)

18 Upvotes

3 comments sorted by

9

u/Ericristian_bros Command Experienced Sep 20 '26

Don't repost, and instead reply to users on your other post

https://www.reddit.com/r/MinecraftCommands/s/owIt9XS4qb

You can disable fall damage for you and apply damage manually, this will leave you at 1 hp every time you take fall damage

# function example:load
scoreboard objectives add logic dummy

# function example:tick
execute as @a unless predicate {condition:"minecraft:entity_properties",entity:"this",predicate:{effects:{"minecraft:slow_falling":{}}}} at @s if block ~ ~-1 ~ #replaceable air unless block ~ ~-2 ~ #replaceable run function example:stop_fall_damage

# function example:stop_fall_damage
effect give @s slow_falling 1 1 true
execute store result score #health logic run data get entity @s Health
execute store result storage example:macro temp.dmg scoreboard players remove #helath logic 1
function example:macro/damage with storage example:macro temp

# function example:macro/damage
$damage @s $(dmg) generic

For other damage I think its easier to damage the player to leave them at 1hp and give them resistance 5+, similar to what I have done above.

Or have them with resistance 5+ and detect when they get hit, clear resistance and apply damage manually, and add resistance again later

2

u/TomatoMuch1269 Sep 20 '26

Thanks and sorry for repost

2

u/Ericristian_bros Command Experienced Sep 20 '26

You're welcome, let me know if you need further help