clickBlockWithItem

fun clickBlockWithItem(blockPos: BlockPos, slot: Int? = null, name: String = "", range: Double = 10.0, fromInv: Boolean = false, abortIfNotFound: Boolean = false): Boolean

Interacts with the block at the gives blockpos with the specified item or slot. Attempts to use the specified item, if not found or specified the specified slot, if not specified the current held item. Performs a check whether that block is in the specified range first.

Return

true when the block is clicked, and false when it is out of range and the click is aborted.

Parameters

fromInv

will also look in the inventory for the item that should be clicked with.

abortIfNotFound

Will abort the click attempt if the specified item can not be found in the inventory. Will return false.