Damage

class Damage(val damage: Int = 1) : ItemAction

The item is damaged by damage.

Constructors

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

Properties

Link copied to clipboard
val damage: Int

The amount of damage to apply to the item.

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.