Consume

class Consume(val decrement: Int = 1) : ItemAction

The stack is shrunk by decrement and a corresponding amount of use remainder items is added, if there is one.

Constructors

Link copied to clipboard
constructor(decrement: Int = 1)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun apply(world: World, itemStack: ItemStack): List<ItemStack>

Applies this action to a copy of itemStack, in the context of world, then returns it. Does not modify the original itemStack. This function is used in cases where the item interaction was not triggered by an entity.

open override fun apply(entity: LivingEntity, slot: EquipmentSlot)

Applies this action to the item in the slot of entity.