Consumable

fun Consumable(nutrition: Int = 0, saturation: Float = 0.0f, canAlwaysEat: Boolean = false, consumeTime: Int = 32, remains: ItemStack? = null, possibleEffects: Map<PotionEffect, Float>? = null, animation: ItemUseAnimation = ItemUseAnimation.EAT, sound: Holder<SoundEvent> = SoundEvents.GENERIC_EAT, particles: Boolean = true): ItemBehaviorFactory<Consumable>

Creates a factory for Consumable behaviors using the given values, if not specified otherwise in the item's config.

Parameters

nutrition

The nutrition that consuming the item provides. Used when nutrition is not specified in the config.

saturation

The saturation that consuming the item provides. Used when saturation is not specified in the config.

canAlwaysEat

Whether the item can always be eaten, even if the player is not hungry. Used when can_always_eat is not specified in the config.

consumeTime

The time it takes to consume the item in ticks. Used when consume_time is not specified in the config.

remains

The item that remains after consuming the item. Used when remains is not specified in the config.

possibleEffects

The possible effects that consuming the item can apply. Used when effects is not specified in the config.

animation

The animation that is played when consuming the item. Used when animation is not specified in the config.

sound

The sound that is played when consuming the item. Used when sound is not specified in the config.

particles

Whether particles are spawned when consuming the item. Used when particles is not specified in the config.