Skip to content

Health regeneration does not exist server-side for non-peaceful difficulties #1855

@WillQizza

Description

@WillQizza

Expected Behavior

If I set the difficulty to easy/normal/hard, my player should recover half a heart every 4 seconds.
If I set the difficulty to peaceful, my player should still receive the recovery above on top of the peaceful natural regeneration.
If the server is a hardcore world, I should not regenerate health naturally.

Actual Behavior

There is no implementation of naturally regenerating your hearts on difficulties higher than peaceful. This causes a desync in health causing the client to display more health than they actually have. (the client regenerates health even if you don't send the update attribute packet)

Steps to Reproduce

  • Set the difficulty to a difficulty above peaceful in your server.properties
  • Damage yourself
  • Ensure that you have full hunger.
  • It will appear that you have regenerated clientside. However, if you take damage it will revert back to the health the server says you have.

Debug information

  • Debug link:
  • Timings link (if relevant):

Crashdump, Backtrace or Other Files

Checklist:

  • [] I included a /debugpaste link
  • I made sure there aren't duplicates of this report (Use Search)
  • I made sure I am using an up-to-date version of Nukkit
  • I Made sure the bug/error is not caused by a plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions