AppleSkin (Port).mcaddon
What's new
Changelog - AppleSkin (Port)
[1.0.0]
Added
- Saturation HUD Overlay: Shows the player's current saturation as a golden outline over the hunger bar, using the same four partial frames as AppleSkin (
icons.pngat u 0/9/18/27). Ported fromHUDOverlayHandler.drawSaturationOverlay(); the per-icon math runs inBP/scripts/modules/hud.js(saturationBar()) and is rendered byRP/ui/lsas/hud.json. - Exhaustion HUD Underlay: Displays food exhaustion as an 81px progress bar behind the hunger bar, filling from the right exactly like
drawExhaustionOverlay()(exhaustion / 4 × 81). The bar is built from 81 one-pixel columns shown with#ex > ncomparisons, because JSON UI division truncates to 0 and would only reveal the bar at maximum exhaustion. - Held Food Preview: While holding food, the hunger and saturation it would restore flash on the HUD, fading in and out on AppleSkin's 1.6s cycle. Foods with harmful effects (
ROTTEN_FOODSinBP/scripts/modules/food.js: rotten flesh, spider eye, raw chicken, pufferfish, poisonous potato) use the green hunger textures. The preview is skipped when the food can't be eaten (canConsume()), matchingHeldFoodCache.query(). - Off-Hand Food Support: The preview falls back to the off-hand item when the main hand holds no edible food, controlled by
showFoodValuesHudOverlayWhenOffhand. - Estimated Health Restored: While holding food, the hearts the player would regenerate flash on the health bar. The estimate is adapted to Bedrock regeneration rules instead of Java's: every health point costs 4 exhaustion (1 saturation, or 1 hunger once saturation is empty) while hunger is at least 18, with no separate fast-regeneration branch (
estimateHealthIncrement()inBP/scripts/modules/food.js, verified in game). Golden apple and enchanted golden apple regeneration is added on top (REGENERATION_FOODS). Hidden in Peaceful, at 18+ hunger, or with Poison, Wither or Regeneration active, as inshouldShowEstimatedHealth(). - Food Values in Item Lore: Hunger and saturation icons are written into the lore of food items (
BP/scripts/modules/tooltip.js), with axNcounter when a food has more than 10 icons, as inTooltipOverlayHandler$FoodTooltip. Icons come from a custom glyph page (RP/font/glyph_E5.png, U+E500–U+E514) so no vanilla glyph page is overridden. Only lines marked with the addon's lore marker are touched, so lore from other addons is preserved. - Tooltip Modes:
showFoodValuesInTooltipAlwayskeeps food values in the lore permanently; with it disabled,showFoodValuesInTooltipshows them only while sneaking, replacing Java's SHIFT key. - Custom Food Support: Food values are read from the
minecraft:foodcomponent (nutrition × saturationModifier × 2), so food items from other addons are detected automatically. Vanilla foods that don't expose the component to scripts fall back to theVANILLA_FOODStable. - Per-Player Configuration: All AppleSkin client settings are saved per player through dynamic properties (
BP/scripts/api/PlayerConfig.js), with the same defaults asModConfig(every overlay enabled, flash alpha 0.65). - Configuration Commands: Added custom commands usable by any player, with no cheats required (
BP/scripts/modules/config.js):/lsas:appleskin [setting] [true|false]: Lists every setting, shows one, or toggles it./lsas:flashalpha [0.0-1.0]: Sets the maximum opacity of the flashing icons, rounded to the nearest of 5 levels (0.25, 0.45, 0.65, 0.85, 1.0). Values below 0.1 hide the preview./lsas:appleskinreset: Restores the default settings.
- Food Stats Command:
/lsas:foodstatsprints the player's exact hunger, saturation and exhaustion (BP/scripts/modules/debug.js), replacing AppleSkin's F3 debug entry. - Translations: Added English (
en_US) and Spanish (es_ES,es_MX) texts for every setting and message inRP/texts/. - Classic and Pocket UI Profiles: The overlays are inserted next to the vanilla heart and hunger renderers in
centered_gui_elements_at_bottom_middle,centered_gui_elements_at_bottom_middle_touchandnot_centered_gui_elements(RP/ui/hud_screen.json), without replacing any vanilla control. Verified in game with the Classic and Pocket profiles. - Script-to-UI Data Channel:
BP/scripts/api/HudChannel.jssends the HUD state through an invisible title (LSASprefix,titleraw @s times 0 0 0), only when it changes. Each icon is encoded as a state character and the UI resolves it into a texture path ('textures/lsas/sat_' + #s0), with a transparent texture for state 0 to avoid missing-texture frames. Verified in game alongside Advanced Netherite, which uses the same channel with its own prefix. - Addon Framework:
BP/scriptsfollows the three-part layoutapi/(framework:Registry,EventBus,PlayerConfig,Commands,HudChannel,Utils),modules/(one file per domain:config,food,hud,tooltip,debug) andmain.jsas the entry point, using@minecraft/server2.9.0 with no experiments and noplayer.jsonchanges. - Asset Generators: Added
tools/with the scripts that generateRP/ui/lsas/hud.json, the per-state HUD textures and the lore glyph page, plusdecode_test.mjsto simulate the UI decoding. Runpwsh tools/build.ps1after changing any of them.tools/README.mddocuments the JSON UI limitations found during development. The folder is not part of the packs.
Known Limitations
- Unsynced Icon Shake: Vanilla shakes the heart and hunger icons with the client's random generator, which scripts can't read, so the overlays stay static and may sit 1px off a shaking icon. An imitation was tested and discarded because it never matched vanilla.
- First Heart Row Only: The estimated health overlay is shown only when all hearts fit in one row (up to 20 max health including absorption).
- Lore Instead of Tooltip Components: Bedrock has no tooltip hook, so a food item picked up without lore may not stack with one that already has it until the lore is applied (every 10 ticks).
- No Vanilla Animations Setting: AppleSkin's
showVanillaAnimationsOverlayis not available for the same reason as the icon shake.
This mod has no additional files

