Skip to main content

BetterFood

A very small and simple as can be plugin that automatically makes players eat cooked and crafted food from their inventories.

The list of valid items is as follows:

ApplesBaked potatoesBeetrootBeetroot soup
BreadCarrotCooked beefCooked chicken
Cooked codCooked muttonCooked porkchopCooked rabbit
Cooked salmonCookiesDried kelpGlow berries
Golden carrotMelon slicesMushroom stewPotato
Pumpkin pieRabbit stewSweet berries

Why?

Honestly I never liked how Mojang implemented the food system. It constantly takes players out of what they're doing in order to fill up a meaningless bar.
I do understand that food is important for a survival game, but I think holding down right click for a few seconds every couple of minutes does not make for a compelling game mechanic.

What about other foods? Raw foods and foods that give buffs are generally best left to manage by the player. However, some commonly-eaten raw foods like carrots, beetroot, and potatoes are included since players often consume these without cooking. Raw meats and foods with special effects remain excluded - you would not want to waste raw meat you're harvesting for cooking, nor foods with valuable buff effects.

Note that golden carrots are included in the auto-eating list. If you prefer to manage this valuable food item manually, store them separately or toggle automatic eating when carrying them.

If people are willing to put the effort in to cook or craft their food, they get to have it refill automatically. Sounds like a good balance, right?

How It Works

When Auto-Eating Triggers

The plugin monitors your hunger level continuously. Whenever your hunger decreases by any amount (even a single point), the plugin searches your inventory for appropriate food and consumes it automatically. This keeps you at or near maximum hunger as long as you have valid food available.

Smart Food Selection

When you get hungry, the plugin doesn't grab the first food it finds. Instead, it intelligently selects the most nutritious food available in your inventory. Foods are ranked by their total restoration value (hunger points + saturation), with better foods being consumed first.

For example, if you have cooked beef (8 hunger + 12.8 saturation = 20.8 total) and cookies (2 hunger + 0.4 saturation = 2.4 total) in your inventory, the plugin will prefer the cooked beef because it provides better overall nutrition.

Saturation Handling

The plugin respects Minecraft's vanilla saturation mechanics. Saturation can never exceed your current hunger level. This means eating high-saturation foods like golden carrots (14.4 saturation) is most effective when your hunger is already high.

Permissions/Commands/Configs:

  • betterfood.user - Plugin only applies to players with this permission.
  • /betterfood (or /bf) - Toggles automatic eating on/off.
  • /betterfood toggleEating (or /bf toggleEating) - Toggles automatic eating for the player.
  • /betterfood toggleMessage (or /bf toggleMessage) - Toggles eating messages for the player.

Note: Commands can only be executed by players. Console execution is not supported.

Tip: Use TAB completion when typing commands to see available options.

Important Behavior Notes

Custom Foods Are Protected

The plugin will only consume vanilla food items without custom names or lore. If you have renamed a food item or if it has lore text (such as from another plugin), BetterFood will NOT automatically consume it. This protects special items from being accidentally eaten.

Examples of protected foods:

  • Food items renamed with an anvil
  • Custom food items from other plugins
  • Quest items that happen to be food
  • Collectible or decorative food items with custom names