pylonWeapon

fun pylonWeapon(stack: ItemStack, key: NamespacedKey, hasDurability: Boolean, hasKnockback: Boolean, disablesShield: Boolean): ItemStackBuilder(source)
fun pylonWeapon(material: Material, key: NamespacedKey, hasDurability: Boolean, hasKnockback: Boolean, disablesShield: Boolean): ItemStackBuilder(source)

Creates a new ItemStack for a PylonItem that can be used as a weapon. You must provide a value for attack-damage, attack-speed and attack-durability-damage in the Settings for the item.

If hasDurability is true, gives the item a max durability defined by durability in the Settings. Otherwise, removes any existing durability.

If hasKnockback is true, gives the item knockback defined by attack-knockback in the Settings. Otherwise, removes any existing attack knockback.

If disablesShield is true, gives the item a shield disable time defined by disable-shield-seconds in the Settings. If false, the item will not disable shields when used in attacking.

settings/example-weapon.yml

attack-damage: 6.0 # double
attack-speed: 1.6 # double
attack-durability-damage: 2 # integer
attack-knockback: 0.4 # double
disable-shield-seconds: 3.0 # float
durability: 500 # integer