Skip to content

Nutrition

roidrole edited this page May 31, 2026 · 1 revision

Allows manipulation of a player's Nutrition

Features:

Nutrition

Import :

import mods.roidtweaker.nutrition.Nutrition;
Method Name Parameters Description
getNutrientList() [None] Returns a string[] containing all nutrient names

The default nutrients are:

  • dairy
  • fruit
  • grain
  • protein
  • vegetable

IPlayer Expansion

The main class of the CT integration. Allows modifying IPlayer nutrition

Method Name Parameters Description
getNutrient nutriment as string Returns the amount of nutrient the player has as a float
setNutrient nutrient as string, amount as float Sets this nutrient's amount to the provided value. Has to be between 0 and 100
addNutrient nutrient as string, amount as float Adds this amount of nutrient to the player. May be negative
addNutrient stack as IItemStack Adds the ItemStack's nutrients to the player, as if they ate the food
resetNutrient nutrient as string Sets this nutrient's amount to whatever the starting amount is

Clone this wiki locally