If you eat a PB&J pup, you normally get a healing and barking in 15s intervals for 5min. But only as long the server runs. When the server is shuts down and restarted again, your remaining regeneration is completely forgotten, even if your regeneration was not yet complete.
Looking at the code, this is because of the way how minetest.after works: https://github.com/minetest/minetest/issues/5488
Just a thought, maybe this would be a good time to invent a potion effect API?
Already exists, it's called “playereffects”:
https://forum.minetest.net/viewtopic.php?f=11&t=9689
Unless you mean it should be added into the engine, then I would love to read your detailed and well thought-out suggestion/plan in a new Minetest issue (if developers have no problem with that).
@Wuzzy2 One in the engine might be nice, although I would be fine with a lua API version. Especially now that player-specific variables exist.
Any kind of effect API should also work for mobs (or entities in general), not only players. And it should not be limited to potions
The non-persistency of the buff was on purpose.
To solve the problem, we should determine if persistency is needed and add something structural for this. But, since it's a rare gimmick, I didn't want to bother for just a single and rare buff.
If we get actual buff food/drinks on a large scale, we can invent something for this, or use playereffects.
I agree, it's not really important if this is lost after a restart because it's a very rare gimmick in normal gameplay and not meant serious.
Yeah i would rather not add code to store remaining player buff over a restart.
Closing as PB&J pup was removed; please move issue to https://github.com/minetest-mods/pbj_pup
Most helpful comment
Just a thought, maybe this would be a good time to invent a potion effect API?