Food API

Quick rating

Food API

No reviews yet

A flexible food system API for NeoForge. Adds configurable hunger capacity and drain speed via attributes, dynamic food bar rendering with multi-row support, and a provider-based icon replacement system for seamless mod integration.

Food & Culinary
Mod Loaders
NeoForge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
Latest Version
1.1
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

line_pink.png

🍖 Food API

A flexible hunger system library for NeoForge

MODRINTH GITHUB

line_pink.png

📖 About

Food API is a developer-focused library that removes the hardcoded limitations of Minecraft's vanilla hunger system. It exposes hunger capacity and drain speed as proper entity attributes, adds multi-row food bar rendering, and provides a clean provider-based system for replacing food icons — all with optional compatibility for popular HUD mods.

line_pink.png

✨ Features

Dynamic hunger capacity — max hunger is now an attribute, supports up to 2 rows (40 units).

Configurable drain speed — control how fast hunger depletes via a multiplier attribute.

Multi-row food bar — second row renders seamlessly above the first, fully synced with vanilla shake animation.

Icon provider system — replace any food icon (empty, half, full, hunger, overlay, saturation) per-player, per-row, per-slot with a simple registration API.

Optional mod compat — native support for Overflowing Bars and AppleSkin when present.

line_pink.png

🖼️ Screenshots

Vanilla rendering — single row, standard icons

4f1ab8e03eedc1e9e5091e0bc2a0801900e134a9.png



With Overflowing Bars — row counter, overlay icons stacked on top

f31e731e85fda7ef4b9ff3fd8d2ab693f02666a1.png
line_pink.png

📦 New Attributes

Two new player attributes are registered automatically when Food API is loaded:

Attribute ID Default Range Description
Max Hunger food_api:max_hunger 20 1 – 40 Maximum hunger capacity. 20 = one row, 40 = two rows.
Hunger Rate food_api:hunger_rate 1.0 0.0 – 10.0 Hunger drain speed multiplier. 0 = no drain, 2 = twice as fast.

Both attributes are synced to the client and can be modified via commands, other mods, or directly in code:

// Example: give a player double hunger capacity
player.getAttribute(AttributeRegistries.MAX_HUNGER)
      .setBaseValue(40);

// Example: slow hunger drain to half speed
player.getAttribute(AttributeRegistries.HUNGER_RATE)
      .setBaseValue(0.5);
line_pink.png

🔧 API Usage

Replacing food icons

Register a provider with an ID and priority. Higher priority wins. Return null to fall through to the next provider.

FoodIconRegistry.register(
    ResourceLocation.fromNamespaceAndPath("mymod", "my_provider"),
    10, // priority — higher = checked first (vanilla = 0)
    (player, iconIndex, row, type) -> {
        // iconIndex: 0 = rightmost icon, 9 = leftmost
        // row: 0 = bottom row, 1 = top row
        return switch (type) {
            case FULL  -> ResourceLocation.fromNamespaceAndPath("mymod", "hud/my_food_full");
            case HALF  -> ResourceLocation.fromNamespaceAndPath("mymod", "hud/my_food_half");
            case EMPTY -> ResourceLocation.fromNamespaceAndPath("mymod", "hud/my_food_empty");
            default    -> null; // let other providers or vanilla handle the rest
        };
    }
);

Icon types

Type Description
EMPTY Background (empty slot)
HALF Half-filled icon
FULL Fully filled icon
EMPTY_HUNGER Background during Hunger effect
HALF_HUNGER Half icon during Hunger effect
FULL_HUNGER Full icon during Hunger effect
HALF_OVERLAY Half icon on top row (Overflowing Bars only)
FULL_OVERLAY Full icon on top row (Overflowing Bars only)
SATURATION Saturation overlay texture (AppleSkin only)

Registering at the right time

Call FoodIconRegistry.register(...) during FMLClientSetupEvent or earlier:

@SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) {
    FoodIconRegistry.register(...);
}
line_pink.png

🔗 Optional Dependencies

Food API works standalone. These mods unlock extra features when present:

  • Overflowing Bars — enables row counter display and overlay icon rendering on the top row
  • AppleSkin — enables saturation overlay icon replacement via FoodIconType.SATURATION
line_pink.png

Made with 🩷 by ArimoV2

Screenshots

Gallery

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works