- check_circle Functions
Published Jan 7th, 2023, 1/7/23 2:18 pm
- 1,806 views, 4 today
- 51 downloads, 0 today
110
Want to slow down regeneration? Or speed it up? Want to decide when a player regenerates half a heart in your pack?
Look no further.
Feel free to use this in your projects!
This Pack sets the gamerule naturalregeneration to false.
If you want to remove the pack run creg:meta/uninstall then disable the pack or delete it.
This Datapack only works if your players dont have over 20 Health (10 Hearts)!
Look no further.
Feel free to use this in your projects!
Changing the Regeneration frequency
go to customregen/data/creg/functions/meta/tick
Edit line 21 and 19 if you need to.
The red parts are what you need to change:
line 21
execute as @a[scores={creg.timer=160..},gamemode=!creative,gamemode=!spectator] run scoreboard players set @s creg.timer 0
Change line 19 if your value in line 21 is lower or near 40 to a lower value
execute as @a[scores={creg.timer=40},gamemode=!creative,gamemode=!spectator] unless score @s creg.health.curr.main = @s creg.health.max.main run function creg:regen
Edit line 21 and 19 if you need to.
The red parts are what you need to change:
line 21
execute as @a[scores={creg.timer=160..},gamemode=!creative,gamemode=!spectator] run scoreboard players set @s creg.timer 0
Change line 19 if your value in line 21 is lower or near 40 to a lower value
execute as @a[scores={creg.timer=40},gamemode=!creative,gamemode=!spectator] unless score @s creg.health.curr.main = @s creg.health.max.main run function creg:regen
Triggering Regen from your Datapack or ingame via Function:
run the function creg:regen as the player that should receive the regeneration.
This Pack sets the gamerule naturalregeneration to false.
If you want to remove the pack run creg:meta/uninstall then disable the pack or delete it.
This Datapack only works if your players dont have over 20 Health (10 Hearts)!
Compatibility | Minecraft 1.18 |
to | Minecraft 1.19 |
Tags |
5820108
119
Create an account or sign in to comment.
#edit the hunger score for how much hunger is needed for the regeneration
execute as @a[scores=creg.hunger=14..},gamemode=!creative,gamemode=!spectator] unless score @s creg.health.curr.main = @s creg.health.max.main run scoreboard players add @s creg.timer 1
#edit the hunger score for how much hunger is needed for the regeneration (this is the score above -1)execute as @a[scores={creg.hunger=..13,creg.timer=1..}] run scoreboard players set @s creg.timer 0
To the hunger value u want.
And remove line 36 (execute unless score @s creg.health.curr matches 21.. run effect give @s minecraft:hunger 2 40 true)
from the modify/remove function
That should do what u want =)