Vanilla

The default crossbow logic that implements vanilla behavior.

Functions

Link copied to clipboard
open override fun canDraw(entity: LivingEntity, crossbow: ItemStack): Boolean

Checks whether entity can start drawing crossbow.

Link copied to clipboard
open override fun chooseProjectile(entity: LivingEntity, crossbow: ItemStack): ChargedProjectiles?

Chooses which projectiles to load into crossbow for entity, returning the loaded projectiles, or null if no projectiles can be loaded.

Link copied to clipboard
open override fun getDrawTime(entity: LivingEntity, crossbow: ItemStack): Int

Gets the amount of ticks it takes for entity to fully draw crossbow.

Link copied to clipboard
open override fun handleDrawTick(entity: LivingEntity, crossbow: ItemStack, tick: Int)

Called every tick while entity is drawing crossbow, with tick counting up from 0.

Link copied to clipboard
open override fun shoot(entity: LivingEntity, hand: EquipmentSlot, crossbow: ItemStack): ItemStack

Shoots the loaded projectiles from crossbow that is in entity's hand, returning the resulting crossbow item stack.