Skip to content
squeek502 edited this page Dec 29, 2014 · 2 revisions

Custom Food Values

Create a .json file (can have any name) in /config/HungerOverhaul with the following format:

{
	// a list of foods and their food values
	// these values will take precedence over HO's default values
	"foods": [
		{
			// the name of the item in "mod:name" format
			"name": "minecraft:golden_apple",
			// [optional] the metadata value of the item (default: 0)
			"meta": 0,
			// the hunger value of the item (1 hunger = 1/2 hunger bar)
			"hunger": 20,
			// the saturation modifier (saturation = hunger * 2 * saturationModifier)
			"saturationModifier": 0.5
		}
	]
}

Custom Blacklists for Food Value Modifications, Right-click Harvesting, and Crop Drops

For users:

Create a .json file (can have any name) in /config/HungerOverhaul with the following format:

{
	// a list of foods that should not have their food values modified by HO
	// the foods in this list will not have their values changed by HO at all (even if specified in the 'foods' section above)
	"foodsBlacklist": [
		{
			// the name of the item in "mod:name" format
			"name": "minecraft:apple",
			// [optional] the metadata value of the item (default: wildcard (any metadata))
			"meta": 0
		}
	],

	// a list of crop blocks that should not have their drops modified by HO
	"dropsBlacklist": [
		{
			// the name of the block in "mod:name" format
			"name": "minecraft:wheat",
			// [optional] the metadata value of the block (default: wildcard (any metadata))
			"meta": 7
		}
	],

	// a list of crop blocks that should not have their right-click behavior modified by HO
	"harvestBlacklist": [
		{
			// the name of the block in "mod:name" format
			"name": "minecraft:wheat",
			// [optional] the metadata value of the block (default: wildcard (any metadata))
			"meta": 7
		}
	]
}

For mod developers:

Send an IMC to "HungerOverhaul" with one of the following keys:

  • "BlacklistFood"
  • "BlacklistRightClick"
  • "BlacklistDrops"

and either a String value (item/block name or class name) or an ItemStack.

Examples:
// blacklist a a specific itemstack (will respect OreDictionary.WILDCARD_VALUE metadata)
FMLInterModComms.sendMessage("HungerOverhaul", "BlacklistFood", new ItemStack(Blocks.wheat));
// blacklist a class and any classes that inherit from it
FMLInterModComms.sendMessage("HungerOverhaul", "BlacklistRightClick", "mods.natura.blocks.crops.CropBlock");
// blacklist a block/item by name
FMLInterModComms.sendMessage("HungerOverhaul", "BlacklistDrops", "minecraft:wheat");