Class FoodBuilder

java.lang.Object
dev.latvian.mods.kubejs.item.FoodBuilder

public class FoodBuilder extends Object
  • Field Details

  • Constructor Details

    • FoodBuilder

      public FoodBuilder()
    • FoodBuilder

      public FoodBuilder(net.minecraft.world.food.FoodProperties properties)
  • Method Details

    • nutrition

      @Info("Sets the hunger restored.") public FoodBuilder nutrition(int h)
    • saturation

      @Info("Sets the saturation modifier. Note that the saturation restored is hunger * saturation.") public FoodBuilder saturation(float s)
    • alwaysEdible

      @Info("Sets whether the food is always edible.") public FoodBuilder alwaysEdible(boolean flag)
    • alwaysEdible

      @Info("Sets the food is always edible.") public FoodBuilder alwaysEdible()
    • eatSeconds

      @Info("Sets seconds it takes to eat the food.") public FoodBuilder eatSeconds(float seconds)
    • fastToEat

      @Info("Sets the food is fast to eat (having half of the eating time).") public FoodBuilder fastToEat()
    • usingConvertsTo

      public FoodBuilder usingConvertsTo(net.minecraft.world.item.ItemStack stack)
    • effect

      @Info(value="Adds an effect to the food. Note that the effect duration is in ticks (20 ticks = 1 second).\n",params={@Param(name="mobEffectId",value="The id of the effect. Can be either a string or a ResourceLocation."),@Param(name="duration",value="The duration of the effect in ticks."),@Param(name="amplifier",value="The amplifier of the effect. 0 means level 1, 1 means level 2, etc."),@Param(name="probability",value="The probability of the effect being applied. 1 = 100%.")}) public FoodBuilder effect(net.minecraft.resources.ResourceLocation mobEffectId, int duration, int amplifier, float probability)
    • removeEffect

      @Info("Removes an effect from the food.") public FoodBuilder removeEffect(net.minecraft.world.effect.MobEffect mobEffect)
    • eaten

      @Info("Sets a callback that is called when the food is eaten.\n\nNote: This is currently not having effect in `ItemEvents.modification`,\nas firing this callback requires an `ItemBuilder` instance in the `Item`.\n") public FoodBuilder eaten(Consumer<FoodEatenKubeEvent> e)
    • build

      public net.minecraft.world.food.FoodProperties build()