Shield

fun Shield(blockDelay: Int = 0, disableCooldownScale: Double = 1.0, damageReductions: List<DamageReduction> = emptyList(), itemDamage: ItemDamageFunction = ItemDamageFunction.itemDamageFunction().build(), bypassedBy: TagKey<DamageType>? = null, blockSound: Key? = null, disableSound: Key? = null): ItemBehaviorFactory<Shield>

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

Parameters

blockDelay

The number of ticks that right-click must be held before successfully blocking attacks. Defaults to 0. Used when block_delay is not specified in the config.

disableCooldownScale

A multiplier that is applied to the number of ticks that the item will be on cooldown for when attacked by a disabling attack. Defaults to 1.0. Used when disable_cooldown_scale is not specified in the config.

damageReductions

A list of DamageReductions of how much damage should be blocked on attack. Defaults to none. Used when damage_reductions is not specified in the config. In configuration damage_reductions is a list of maps with keys base (float), factor (float), horizontal_blocking_angle (float), type (damage type tag/key/list of keys).

itemDamage

Specifies how much damage is applied to the item when it blocks an attack. Used when item_damage is not specified in the config. In configuration item_damage is a map with keys threshold (float), base (float), factor (float).

bypassedBy

A damage type tag containing the damage types that bypass the shield. Can be null if no damage types bypass the shield. Defaults to null. Used when bypassed_by is not specified in the config.

blockSound

The sound that is played when the shield successfully blocks an attack. Can be null if no sound should be played. Defaults to null. Used when block_sound is not specified in the config.

disableSound

The sound that is played when the shield is disabled by a disabling attack. Can be null if no sound should be played. Defaults to null. Used when disable_sound is not specified in the config.