WorldGuard

WorldGuard

8M Downloads

Feature Request : Add a natural-regeneration flag

LadyCailinBot opened this issue ยท 10 comments

commented

WORLDGUARD-3297 - Reported by val59000

This is a feature request

I'm trying to set a custom region where people would regain health at a certain speed and with a maximum health with the flags heal-max-health , heal-delay , heal-amount. It works but not perfectly.

To make it work perfectly I have to disable the natural regeneration on the whole map (with /gamerule naturalRegeneration false) , otherwise my custom Worldguard rule and the vanilla regeneration are both regenerating players lives.

Is it possible to add to Worldguard a flag like "natural-regeneration" to allow or deny the natural regeneration in specific region instead of needing to disable it on the whole map with a gamerule ?

Thanks !

val59000

commented

Comment by PseudoKnight

So on EntityRegainHealthEvent, if entity is a player and RegainReason is SATIATED and heal-amount is not null, cancel the event. This would change the effective heal or damage rate in regions that use heal-amount, but they'd have to really care about the precise timing for it to be a problem. Not sure if it's okay or not.

commented

Comment by val59000

I didn't get what you mean about the timing.
I'm just saying that the heal-amount flag is rather useless if it can't be separated of the natural regeneration
Because the point of heal-amount and these related flags is to set a custom health regain rule in a region, so you don't want the default rule to interfer wit the rule you are setting, right ?

commented

Comment by PseudoKnight

Well, heal flags can be used in conjunction with normal health regen. Consider if someone wanted to make it so players always regen up to 5hp, but you can only regen more hp if you are satiated. I'm not saying the idea is without merit, but it does change things. That said, I think these flags were added before hunger was added to MC.

commented

Comment by Nolora

Alternatively, you can disable naturalRegeneration rule, and set it with flags on the global region.
Then, if you redefine the flag in child regions, delays and amounts will be overriden.

commented

Comment by val59000

Nice workaround, thanks

commented

Comment by sk89q

Err, how does that workaround work? Or is that a proposed workaround if this flag was created?

commented

Comment by Nolora

Not sure to understand your question ? But what I proposed (not tested) is a solution that don't need to create a new flag.

commented

Comment by sk89q

...do I need to actually add this flag then? Rather not add flags unless a lot of people need them.

commented

Comment by val59000

It would still be a usefull flag in complement of heal-amount etc... But I understand that you can't add every flag to Worlguard. I guess I'll find another way to do what I need.

commented

Comment by val59000

Or maybe it would be useful to deactivate natural regeneration in a region when heal-amount is set to a value ?