Alright, buckle up...
BodyHealth v3.0.0
New official addon: LocationalArmorAddon (BodyHealth v3.0.0+, Minecraft v1.21.3+)
Added a %BodyPart% placeholder to the COMMAND and COMMAND_UNDO effects that translates into the BodyPart that caused the effect, so you can copy/paste the effect onto different parts
Added a new update checker that checks for updates on Modrinth, works with dev versions and prereleases, and formats update notifications a bit nicer
Added a new config option that allows you to chose whether to check for development versions and prereleases, or full releases only
Added permission overrides to the body-health and body-damage configuration sections (examples are added to your config)
Added a %bodyhealth_enabled% PAPI placeholder that returns true when BodyHealth is enabled for a player
Added more robust error logging for throwables and error logging for failing math expressions
Added new meta effects (DELAYED & REPEATING) to execute effects delayed and/or repeating
Improved the default effect config to still use all effects there are, but while actually making sense in a survival environment, so it can now be used without changes (check it out here)
Improved MySQL and SQLite storage types to use HikariCP for extra performance and stability
Improved various methods to be thread safe when used by multiple plugins/addons at the same time
Improved debug logging to not only include the calling class, but now also the line of code
Improved various comments within the plugin's source code and its configuration file
Improved parsing of the body-damage section to warn users in case of invalid entries
Improved meta effects to allow you to chain them together
Fixed missing javadoc params in the BodyHealth and EffectHandler classes
Fixed en-us being set as the default language, despite the file being named en.yml
Fixed attribute modifiers being expected in one specific format, causing errors with other formats present
Updated the following wiki entries: Setup Guide, API Usage, Addons
For Developers
Events
Added causing/underlying event to BodyPartHealthChangeEvent (retrieve with BodyPartHealthChangeEvent#getCause, can optionally be set via API)
Fixed health value in BodyPartHealthChangeEvent#setNewHealth being set as an int instead of double
Effects
Added methods that let you register your own BodyHealthEffects via the API or directly within an addon's main class (docs)
API
Added way more methods to the BodyHealthAPI class to ensure you don't have to touch anything else in most cases (check it out here)
Changed BodyHealthAPI#getInstance to BodyHealthAPI#getBodyHealthPlugin and BodyHealthAPI#reloadSystem to BodyHealthAPI#reloadBodyHealthPlugin
Changed BodyHealthAPI to be object based, retrievable with BodyHealthAPI#getInstance
Addons
Overhauled the AddonFileManager class, simplifying its use, adding javadoc comments and adding a new method that lets you update yaml configurations with BodyHealth's config updater
Overhauled the AddonManager class, also simplifying it, adding javadoc comments and adding logging that's up to standard with the rest of the plugin
Added AddonDebug#logRaw for you to log something regardless of debug or dev mode being enabled
Improved addon debug methods to also include logging for throwables and the calling line of code
Fixed debug messages in the AddonManager class not logging enough information to tell what addon caused something
tl;dr:
This update includes a lot (and I mean A LOT) of things.
If you're a developer using the API and/or addon system, prepare for breaking changes and read at least the "For Developers" section.
Casual users should be fine, as the plugin's config is updated automatically.
Enjoy!
-
Added a new config option that allows using the
/kill
command to kill players with the KILL_PLAYER effect as that's more consistent across different server software than using the API -
Added meta effects WHEN_DAMAGED & WHEN_HEALED. These allow triggering effects only when conditions are met due to the player taking damage or regenerating. For example,
when_damaged/sound/minecraft:entity.bogged.hurt
ateffects.BODY.INTERMEDIATE
would trigger the sound when the state of your body changes from NEARLYFULL to INTERMEDIATE (damage), but NOT when it changes from DAMAGED to INTERMEDIATE (regeneration). -
Categorized effects into persistent, one-time and meta effects
-
Improved effect keyword matching to allow case-insensitive identifiers
-
Updated validation methods to reflect the above
-
Corrected config comments
Advanced HUD positioning and more!
Added a new positioning option that allows you to specify an anchor point for BodyHealth's HUD (e.g. BOTTOM_LEFT). The HUD's position will always be relative to that anchor point, no matter the screen ratio and resolution, and the correct offsets are automatically calculated and applied for you. The anchor point therefore effectively changes the HUD's default position to one of nine possible places from where you can still move it in all directions with the offset values from the last update.
Added a new option in the display section that automatically reloads BetterHud together with BodyHealth when enabled to instantly apply any changes there.
Improved the PREVENT_JUMP and PREVENT_WALK effects to handle their attribute modifiers more consistently and hopefully never leave them applied under any circumstances ever again due to other plugins interfering with them.
Sidenote: When repositioning the HUD, always adjust the anchor point first and then use the offsets from last update if needed.
A few things...
- Added SOUND effect to play sounds to only the target player
- Added an option to disable BetterHud's entity popup feature
- Added customizable offsets to BodyHealth's HUD (can be found in a new "position" category at display.betterhud)
- Added yet another safety feature for attribute modifiers to ensure they are removed correctly in any case
- Updated the effect config's default values to include the new SOUND effect and to match the newest version's syntax
- Improved the three display.betterhud.disable options to re-enable the respective features when set to false
- Improved the display.betterhud.as-default option to be reversible too
- Fixed a few typos here and there (mostly internal + debug messages)
- Removed fix-height option in favor of the new offsets
MiniMessage Support!
All messages (except debug messages) can now use MiniMessage formatting in addition to legacy color/formatting codes like &c (red). Some things like coloring the shadow of your text isn't possible in Minecraft, as this is handled client side, but you can now use all 16.7M colors in the RGB spectrum, add hover text to your messages, execute commands when someone clicks them and much more!
Messages sent to players may now also contain PAPI placeholders to show your players additional information like.... the current date and time for example (hover text):
BodyHealth's default messages are still formatted using legacy codes due to them being much shorter.
Storage update!
- Added SQLite storage type (new default)
- Added MySQL storage type for multi server environments
- Improved data handling to only load data needed at a given time, unloading and saving data for players when they disconnect, etc.
With SQLite being the new default storage method, loading times should no longer scale with the number of players of which data is stored that much, resulting in loading times hundreds if not thousands of times faster than before, depending on how many entries there are in your YAML storage. Speaking of which, it is still available to use, as it's way more readable and therefore great for debugging.
You can find storage settings in a new config section between the raytracing- and body-health settings within config.yml :)
Changed Assembled resource packs now have their own output folder and the existing packaging process of BetterHud's assets to a usable resource pack has been updated to:
...fully support all versions from 1.21 upwards (no more red highlighted, outdated packs)
...make it a little more presentable by reworking the pack's description and adding sort of a gradient
...allow customizing the filenames of generated resource packs
Improved Body parts are now case-insensitive across all commands
Fixed Mc 1.21.3 introduced a bug that renders it impossible to retrieve the block that damaged a player under certain circumstances (e.g. lava). BodeHealth now applies damage to all body parts in these cases, instead of spamming errors. (PaperMC/Paper#11984)
Fixed players body parts not being healed after respawning under certain circumstances
Previous behavior: Fully heal players 3 ticks after respawning if the system is enabled where they respawn.
Revised behavior (now): Fully heal players body parts 1 tick after respawning regardless of the system being enabled at their respawn point
After changing this effect from SEND_MESSAGE to just MESSAGE by accident, then pushing a fix for it that somehow didn't end up in any release and ultimately deciding to leave it at MESSAGE, we somehow ended up in a state where the default config generates a SEND_MESSAGE effect whilst the effect engine only knows MESSAGE....
Changed This update therefore adjusts the default configuration and the effect explanation to say MESSAGE instead of SEND_MESSAGE to finally end the confusion
IF YOU CURRENTLY USE THE MESSAGE/SEND_MESSAGE EFFECT, MAKE SURE IT SAYS "MESSAGE"
Fixed POTION_EFFECT effect not correctly parsing the potion effect's amplifier from your effect configuration and defaulting to 256 instead of 1. Please report stuff like this if you notice something is wrong. I won't hunt you down for invalid reports, I promise
Changed (Internal) BodyHealthEffects.java is now split up into an EffectHandler and a unique effect class per effect, implements a new BodyHealthEffect interface. This change aims to make the code more readable and to make it easier for future addons to add their own effects.
Improved Some code cleanup here and there to reach that A+ code quality on CodeFactor