Skip to content
/ kFood Public

[Bukkit] A plugin that abolishes the default food system and provides a new one with API.

License

Notifications You must be signed in to change notification settings

7kasper/kFood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kFood

kFood is a standalone plugin that abolishes minecraft's new food system and replaces it with a customizable system that resembles the way food used to work.

Why?

I made this plugin to get myself familliar with bukkit again, it has been a loooonng while since I coded with it. Oh and by the way, I just really didn't like the food system 😄

Features

  • Ensure players' foodLevels stay static.
  • Give individual players different foodLevels.
  • Make eating food increase health instead of the foodLevel.
  • Set the halfHeartsToAdd for each food.
  • Configure some effects when eated.
  • Configure new (instant) foods.
  • Set which foods can be eaten instantly.
  • Set which instantFoods should return a bowl.

itemNames

There are many plugins that reintroduce minecraft's old way of handling food. Most of them look to the material of the item to know how much food to apply; here kFood differs.

kFood's unique feature is to look at item names to identify which food it is. This has a few upsides:

  • More customization!
  • (better) support for items from other plugins.
  • (better) support for mods.
  • The ability to give different kinds of fish different amounts of halfHeartsToHeal.

To get every item's name kFood has to rely on NMS code. It uses reflection for this so it shouldn't break on a update. In fact, when a new food is added to the game you can add it to the config, no coding required.
The downside: if any major changes happen to bukkit's CraftItemStack class or NMS' ItemStack class this plugin will break and need updating.

anvilItems

The previous feature raises some questions regarding anvils. What happens when a player takes a piece of Rotten Flash and renames it to Golden Carrot?

On default if an anvilItem is eaten kFood will first check if an anvil name is specifically set. If not kFood will (for now) instead check against the original item's name.

foodLevels

Even though this plugin renders the foodbar practically useless, the effects of it do still remain. This allows for some interesting features. If you set your foodLevel lower than 3 for instance, players cannot run anymore. The way the client works, it won't even try to send a sprinting packet. If a player has a foodLevel higher than 17 it will slowly regenerate hearts.

kFood stores the foodLevel of all players in the main scoreboard under the "food" objective. Having a score_food of 0 (default) means that you have the default-food. This way you can use commandblocks or other plugins to give individual players different foodlevels, for instance to make a certain area where players can or cannot run.

About

[Bukkit] A plugin that abolishes the default food system and provides a new one with API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages