Skip to content

3.9.0: update check, decimal health, health colors, off by default, Modrinth and Hangar uploads - #79

Merged
zeshan321 merged 2 commits into
masterfrom
feat/3.9.0
Oct 3, 2026
Merged

zeshan321 merged 2 commits into
masterfrom
feat/3.9.0

Conversation

@zeshan321

@zeshan321 zeshan321 commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

The first part of the plan to win back servers. bStats shows 190 servers, down from about 2,250 in 2022. 65% of them still run 3.5.9, which our tests show sends no action bar on 1.21 and later. This PR helps owners find out about new versions, and it adds the small features that owners asked for on Spigot. It also makes each release upload to Modrinth and Hangar. The version is 3.9.0.

New features

  • Update check. support/UpdateChecker.java asks api.spigotmc.org/legacy/update.php?resource=2661 once a day, starting 5 seconds after the plugin starts. The request runs on a background thread (the async scheduler on Folia).
    • A new version is logged once: ActionHealth X is available. This server runs Y. Download it at <Spigot page>.
    • Players with the new permission ActionHealth.Update (op by default) get the Update Message 2 seconds after they join.
    • A failed check is logged only at the FINE level, so a server without internet access gets no warnings.
    • The request sends only a User-Agent: ActionHealth/<version> header. The system property actionhealth.updateurl replaces the URL, for tests.
    • Update Check: true is the default, also in old configs. The header of the added options now says "except Update Check", because this option changes what the plugin does.
  • Decimal health. Health Decimals (0 to 3) applies to {health}, {maxhealth}, {absorption} and {opponentlastdamage}. Extra decimals are cut off, so 19.99 does not show as full health. The separator is always a dot. Requested in a May 2022 review.
  • Health colors. {healthcolor} takes the color from Health Colors for the percentage of health left. Requested in June 2022.
  • Off by default. With Enabled By Default: false, players see nothing until they run /actionhealth toggle. toggles.yml now has an enabled list next to toggled. Both choices are saved, so a change of the default does not turn a saved choice around. Requested in July 2023.
  • Command messages in the config. Reload Message and Help Message replace the hard-coded text.

Bug fixed

  • A living mob with less than 1 health showed 0 health, because the code cast health to an integer. {health} now shows at least the smallest step (1, or 0.1 with 1 decimal). {percenthealth} shows at least 1.

Release workflow

  • A new publish job runs after the GitHub release. It downloads the jar and the release text from the GitHub release, so all sites get the same file. Then it runs .github/scripts/publish-modrinth.sh and publish-hangar.sh.
  • Each upload runs only if its secret exists: MODRINTH_TOKEN and HANGAR_TOKEN. Without a secret, the job writes a notice and skips that site.
  • workflow_dispatch with a tag input uploads an existing release again. If a site already has the version, the script skips it.
  • MINECRAFT_VERSIONS: 1.8-26.3 in the workflow sets the tested range. The Modrinth script lists every Minecraft release in it (75 versions). Hangar takes the range as it is.
  • The tag instructions now use git tag -a <version> --cleanup=verbatim -F notes.md. Without --cleanup=verbatim, git removed the ### headings from the 3.8.0 and 3.8.1 tag messages.

Tests

  • Unit tests: 65 pass, 19 of them new.
    • HealthFormatTest: decimals are cut off, the separator is a dot with a German locale, a living entity never shows 0, and the color thresholds.
    • UpdateCheckerTest: version comparison (3.10.0 is newer than 3.9.2), and an answer that is not a version is ignored.
    • ToggleStoreTest: off by default, saved choices after a restart, and a change of the default.
    • ConfigUpdaterTest: the header names Update Check.
  • Linkage check: 68 of 68 spigot-api versions pass.
  • New bot checks:
    • health-color: 10/10 is green at full health.
    • decimals: Cow: 10.0/10.0.
    • update-check: run.sh makes the check read 99.0.0 from a local file. The log names it, and an operator bot gets the message when it joins.
    • reload-message: an operator bot gets the Reload Message.
    • default-off: a new bot gets no action bar until it runs /actionhealth toggle.
  • CI set (5 servers), all 20 checks pass on each: Spigot 1.8.8, Spigot 1.21.11, Paper 26.3, Paper 1.21.11 with Adventure, Folia 1.21.11.
  • Full set on the 3.9.0 jar:
    • 27 Spigot versions, 1.8 to 26.3: 26 pass at once. Spigot 26.3 failed consume and action-tags in the first run: Bot2 drank the potion, but Bot1 got no message. I ran 26.3 two more times, and both runs passed. This PR does not change the action code, and the same check passes on Paper 26.3. I did not find the cause, so the compat README records it as unknown.
    • Paper 1.8.8, 1.20.6, 1.21.11 and 26.3: pass.
    • Paper 1.16.5 with the Adventure method: pass.
    • Folia 1.21.11 and 26.2: pass.
    • WorldGuard 6.1, 6.2.2, 7.0.15 and 7.0.19: pass.
    • PlaceholderAPI 2.12.3 on 1.8.8 and 26.3: pass.
    • ModelEngine R3.1.11 on 1.20.4: pass.
  • Live endpoint: api.spigotmc.org returns 3.8.1. A Java 8 (1.8.0_504) URLConnection with the same timeouts and User-Agent reads it too.
  • Publish scripts: both pass shellcheck. A dry run of the Modrinth script lists the same 75 versions that the Modrinth page has for 3.8.1. actionlint reports one note, which the old workflow already had.

Not tested

  • A real upload to Modrinth or Hangar. The secrets do not exist yet, and the scripts follow the Modrinth InitialVersionData source and the Hangar OpenAPI spec. The first real run will be the 3.9.0 release, or a manual run for 3.8.1.
  • The update check against spigotmc.org from a running server. The bot tests use a local file, so they do not depend on the network.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD

zeshan321 and others added 2 commits October 3, 2026 01:49
…tion

- Update Check: asks spigotmc.org once a day for the latest version number.
  Logs a new version and tells players with ActionHealth.Update on join.
- Health Decimals: up to 3 decimals for health numbers. A living entity no
  longer shows 0 health.
- {healthcolor}: a color from Health Colors for the health that is left.
- Enabled By Default: players can opt in with /actionhealth toggle.
  toggles.yml now keeps the players who turned it on, too.
- Reload Message and Help Message are configurable.
- Release workflow: uploads the release jar to Modrinth and Hangar when
  their secrets exist, and can upload an existing tag by hand.
- Tag instructions use --cleanup=verbatim, so "###" headings stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T5MqrCm9Pp5CcLQ15xzmxD
@zeshan321
zeshan321 merged commit 6fe3531 into master Oct 3, 2026
4 checks passed
@zeshan321
zeshan321 deleted the feat/3.9.0 branch October 3, 2026 06:22
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.

1 participant