Class ExpandFoodProperties
java.lang.Object
com.blamejared.crafttweaker.natives.food.ExpandFoodProperties
Represents the properties of a food item.
- DocParam:
- this FoodProperties.create(1, 1.0, true, 1.0)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder to help create new food properties.static classRepresents a possible effect of the food properties. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanAlwaysEat(net.minecraft.world.food.FoodProperties internal) Gets whether the food can always be eaten.static net.minecraft.world.food.FoodPropertiescreate(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds) Creates a new food properties.static net.minecraft.world.food.FoodPropertiescreate(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, IItemStack usingConvertsTo) Creates a new food properties.static net.minecraft.world.food.FoodPropertiescreate(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, IItemStack usingConvertsTo, List<net.minecraft.world.food.FoodProperties.PossibleEffect> effects) Creates a new food properties.static floateatSeconds(net.minecraft.world.food.FoodProperties internal) Gets the number of seconds it takes to eat the food.static List<net.minecraft.world.food.FoodProperties.PossibleEffect> getEffects(net.minecraft.world.food.FoodProperties internal) Gets the effects of the food properties.static intnutrition(net.minecraft.world.food.FoodProperties internal) Gets the nutrition value of the food properties.static floatsaturation(net.minecraft.world.food.FoodProperties internal) Gets the saturation modifier of the food properties.static IItemStackusingConvertsTo(net.minecraft.world.food.FoodProperties internal) Gets the item that the food converts to when eaten.static net.minecraft.world.food.FoodPropertieswithCanAlwaysEat(net.minecraft.world.food.FoodProperties internal, boolean canAlwaysEat) Creates a new food properties based on this instance, with the given can always eat value.static net.minecraft.world.food.FoodPropertieswithEatSeconds(net.minecraft.world.food.FoodProperties internal, int eatSeconds) Creates a new food properties based on this instance, with the given eat seconds value.static net.minecraft.world.food.FoodPropertieswithEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect, float probability) Creates a new food properties based on this instance, with the given effect.static net.minecraft.world.food.FoodPropertieswithEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.food.FoodProperties.PossibleEffect effect) Creates a new food properties based on this instance, with the given effect.static net.minecraft.world.food.FoodPropertieswithEffects(net.minecraft.world.food.FoodProperties internal, List<net.minecraft.world.food.FoodProperties.PossibleEffect> effects) Creates a new food properties based on this instance, with the given effects.static net.minecraft.world.food.FoodPropertieswithNutrition(net.minecraft.world.food.FoodProperties internal, int nutrition) Creates a new food properties based on this instance, with the given nutrition value.static net.minecraft.world.food.FoodPropertieswithoutEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffect effect) Creates a new food properties based on this instance, without the given effect.static net.minecraft.world.food.FoodPropertieswithoutEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.food.FoodProperties.PossibleEffect effect) Creates a new food properties based on this instance, without the given effect.static net.minecraft.world.food.FoodPropertieswithSaturation(net.minecraft.world.food.FoodProperties internal, float saturation) Creates a new food properties based on this instance, with the given saturation modifier.static net.minecraft.world.food.FoodPropertieswithUsingConvertsTo(net.minecraft.world.food.FoodProperties internal, IItemStack usingConvertsTo) Creates a new food properties based on this instance, with the given using converts to value.
-
Constructor Details
-
ExpandFoodProperties
public ExpandFoodProperties()
-
-
Method Details
-
create
public static net.minecraft.world.food.FoodProperties create(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds) Creates a new food properties.- Parameters:
nutrition- The nutrition value.saturation- The saturation value.canAlwaysEat- Whether the food can always be eaten.eatSeconds- The number of seconds it takes to eat the food.- Returns:
- The new food properties.
-
create
public static net.minecraft.world.food.FoodProperties create(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, IItemStack usingConvertsTo) Creates a new food properties.- Parameters:
nutrition- The nutrition value.saturation- The saturation value.canAlwaysEat- Whether the food can always be eaten.eatSeconds- The number of seconds it takes to eat the food.usingConvertsTo- The item that the food converts to when eaten.- Returns:
- The new food properties.
-
create
public static net.minecraft.world.food.FoodProperties create(int nutrition, float saturation, boolean canAlwaysEat, float eatSeconds, IItemStack usingConvertsTo, List<net.minecraft.world.food.FoodProperties.PossibleEffect> effects) Creates a new food properties.- Parameters:
nutrition- The nutrition value.saturation- The saturation value.canAlwaysEat- Whether the food can always be eaten.eatSeconds- The number of seconds it takes to eat the food.usingConvertsTo- The item that the food converts to when eaten.effects- The effects that the food applies when eaten.- Returns:
- The new food properties.
-
nutrition
public static int nutrition(net.minecraft.world.food.FoodProperties internal) Gets the nutrition value of the food properties.- Returns:
- The nutrition value.
-
withNutrition
public static net.minecraft.world.food.FoodProperties withNutrition(net.minecraft.world.food.FoodProperties internal, int nutrition) Creates a new food properties based on this instance, with the given nutrition value.- Parameters:
nutrition- The new nutrition value.- Returns:
- The new food properties.
-
saturation
public static float saturation(net.minecraft.world.food.FoodProperties internal) Gets the saturation modifier of the food properties.- Returns:
- The saturation modifier.
-
withSaturation
public static net.minecraft.world.food.FoodProperties withSaturation(net.minecraft.world.food.FoodProperties internal, float saturation) Creates a new food properties based on this instance, with the given saturation modifier.- Parameters:
saturation- The new saturation modifier.- Returns:
- The new food properties.
-
canAlwaysEat
public static boolean canAlwaysEat(net.minecraft.world.food.FoodProperties internal) Gets whether the food can always be eaten.- Returns:
- Whether the food can always be eaten.
-
withCanAlwaysEat
public static net.minecraft.world.food.FoodProperties withCanAlwaysEat(net.minecraft.world.food.FoodProperties internal, boolean canAlwaysEat) Creates a new food properties based on this instance, with the given can always eat value.- Parameters:
canAlwaysEat- The new can always eat value.- Returns:
- The new food properties.
-
eatSeconds
public static float eatSeconds(net.minecraft.world.food.FoodProperties internal) Gets the number of seconds it takes to eat the food.- Returns:
- The number of seconds it takes to eat the food.
-
withEatSeconds
public static net.minecraft.world.food.FoodProperties withEatSeconds(net.minecraft.world.food.FoodProperties internal, int eatSeconds) Creates a new food properties based on this instance, with the given eat seconds value.- Parameters:
eatSeconds- The new eat seconds value.- Returns:
- The new food properties.
-
usingConvertsTo
Gets the item that the food converts to when eaten.- Returns:
- The item that the food converts to when eaten.
-
withUsingConvertsTo
public static net.minecraft.world.food.FoodProperties withUsingConvertsTo(net.minecraft.world.food.FoodProperties internal, IItemStack usingConvertsTo) Creates a new food properties based on this instance, with the given using converts to value.- Parameters:
usingConvertsTo- The new using converts to value.- Returns:
- The new food properties.
-
getEffects
public static List<net.minecraft.world.food.FoodProperties.PossibleEffect> getEffects(net.minecraft.world.food.FoodProperties internal) Gets the effects of the food properties.- Returns:
- The effects of the food properties.
-
withEffect
public static net.minecraft.world.food.FoodProperties withEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffectInstance effect, float probability) Creates a new food properties based on this instance, with the given effect.- Parameters:
effect- The effect to add.probability- The probability of the effect.- Returns:
- The new food properties.
-
withEffect
public static net.minecraft.world.food.FoodProperties withEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.food.FoodProperties.PossibleEffect effect) Creates a new food properties based on this instance, with the given effect.- Parameters:
effect- The effect to add.- Returns:
- The new food properties.
-
withEffects
public static net.minecraft.world.food.FoodProperties withEffects(net.minecraft.world.food.FoodProperties internal, List<net.minecraft.world.food.FoodProperties.PossibleEffect> effects) Creates a new food properties based on this instance, with the given effects.- Parameters:
effects- The new effects.- Returns:
- The new food properties.
-
withoutEffect
public static net.minecraft.world.food.FoodProperties withoutEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.effect.MobEffect effect) Creates a new food properties based on this instance, without the given effect.- Parameters:
effect- The effect to remove.- Returns:
- The new food properties.
-
withoutEffect
public static net.minecraft.world.food.FoodProperties withoutEffect(net.minecraft.world.food.FoodProperties internal, net.minecraft.world.food.FoodProperties.PossibleEffect effect) Creates a new food properties based on this instance, without the given effect.- Parameters:
effect- The effect to remove.- Returns:
- The new food properties.
-