Package dev.latvian.mods.kubejs.item
Class FoodBuilder
java.lang.Object
dev.latvian.mods.kubejs.item.FoodBuilder
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalwaysEdible(boolean flag) net.minecraft.world.food.FoodPropertiesbuild()eatSeconds(float seconds) effect(net.minecraft.resources.ResourceLocation mobEffectId, int duration, int amplifier, float probability) nutrition(int h) removeEffect(net.minecraft.world.effect.MobEffect mobEffect) saturation(float s) usingConvertsTo(net.minecraft.world.item.ItemStack stack)
-
Field Details
-
eaten
-
-
Constructor Details
-
FoodBuilder
public FoodBuilder() -
FoodBuilder
public FoodBuilder(net.minecraft.world.food.FoodProperties properties)
-
-
Method Details
-
nutrition
-
saturation
@Info("Sets the saturation modifier. Note that the saturation restored is hunger * saturation.") public FoodBuilder saturation(float s) -
alwaysEdible
-
alwaysEdible
-
eatSeconds
-
fastToEat
@Info("Sets the food is fast to eat (having half of the eating time).") public FoodBuilder fastToEat() -
usingConvertsTo
-
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()
-