ConvertOne

class ConvertOne(newItemStack: ItemStack) : ItemAction

One item from the stack is converted into newItemStack. newItemStack will not be modified.

Constructors

Link copied to clipboard
constructor(newItemStack: ItemStack)

Properties

Link copied to clipboard
val newItemStack: @NotNull ItemStack

The new item stack that one item is converted into.

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.