Shield

fun Shield(blockDelay: Int = 0, disableCooldownScale: Double = 1.0, bypassedBy: TagKey<DamageType>?, blockSound: Sound?, disableSound: Sound?): ItemBehaviorFactory<Shield>
fun Shield(blockDelay: Int = 0, disableCooldownScale: Double = 1.0, 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.

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.