Skip to content

Fix: health reset on join#534

Open
DeathGOD7 wants to merge 5 commits into
Auxilor:masterfrom
DeathGOD7:fix/health-reset
Open

Fix: health reset on join#534
DeathGOD7 wants to merge 5 commits into
Auxilor:masterfrom
DeathGOD7:fix/health-reset

Conversation

@DeathGOD7

Copy link
Copy Markdown
Contributor

Before it would just check after 5 tick for health update, and it will permanently update the health regardless of old saved health.
Since some plugin might load after eco, there can be issue of health reset bug. (as stated in discord)

I have implemented task to run on interval each tick for 100 tick for health change.

@DeathGOD7

DeathGOD7 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Also, this was the exception it printed on console (eco 7.6.2):

[02:50:28 WARN]: [eco] Task #6796 for eco v7.6.2 generated an exception
java.lang.IllegalArgumentException: Health value (48.0) must be between 0 and 20.0. (attribute base value: 20.0, player: RexSE7EN_)

@CallumJohnson CallumJohnson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a couple changes to address, nice work !!

@DeathGOD7

Copy link
Copy Markdown
Contributor Author

Doing build check before publishing changes to branch.

add: new config key "health-fix-duration"
add: new helper function named "getNewHealth"
remove: duplicate or unnecessary variables with same value
chore: made code more readable
@DeathGOD7 DeathGOD7 requested a review from CallumJohnson June 12, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants