FakeActionUtils

Collection of functions for performing fake player interactions.

Author

Aton

Functions

Link copied to clipboard
fun clickBlock(blockPos: BlockPos, range: Double = 10.0): Boolean

Interacts with the block at the gives blockpos with the currently held item. performs a check whether that block is in the specified range first. Returns true when the block is clicked, and false when it is out of range and the click is aborted.

Link copied to clipboard
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.

Link copied to clipboard
fun clickItem(name: String, rightClick: Boolean = true, swapBack: Boolean = true): Boolean

Attempts to swap to and click the item containing given name in the hotbar. The same action as on a manual click is performed. so this will prioritise to interact with things instead of using the item ability. returns true if successful, false otherwise.

Link copied to clipboard
fun etherwarpTo(targetPos: BlockPos, message: Boolean = false, fakeTp: Boolean = false): Boolean

Stages an etherwarp fake action to the specified block pos. Returns false as well as sends a chat message if etherwarp not possible. Checks the center of all 6 sides of the block for visibility.

Link copied to clipboard
fun forceEtherwarp(start: Vec3, targetPos: BlockPos, message: Boolean = false, queueMode: Boolean = false, fakeTp: Boolean = false): Boolean

Stages an etherwarp fake action to the specified block pos for the given start vec which is assumed to be the players coordinates (at feet level). The top center of the block will be targeted. It will not check whether the target can be seen.

Link copied to clipboard
fun interactWithEntity(entityId: Int)

Interacts with the entity with the given id by sending the interaction package.

fun interactWithEntity(entity: Entity)

Interacts with the given entity by sending the interaction package.

Link copied to clipboard
fun legitClickEntity(entity: Entity)

Do not use for armorstands.

Link copied to clipboard
fun swapArmorItem(itemName: String, blockedSlots: Int = 0, ignoreCase: Boolean = true): Int?

Swaps out the first item found that matches the given name with the corresponding worn armor piece.

Link copied to clipboard
fun swapItemToSlot(sourceSlot: Int, targetSlot: Int): Boolean

Swaps the item in sourceSlot to the targetSlot in your hotbar.

fun swapItemToSlot(regex: Regex, target: Int, matchMode: Int = 0): Boolean

Looks for the specified item in your inventory queues to and swaps it to the specified target slot.

Link copied to clipboard
fun tryEtherwarp(start: Vec3, targetPos: BlockPos, message: Boolean = false, queueMode: Boolean = false, fakeTp: Boolean = false): Boolean

Stages an etherwarp fake action to the specified block pos for the given start vec which is assumed to be the players coordinates (at feet level). Returns false as well as sends a chat message if etherwarp not possible. Checks the center of all 6 sides and all corners of the block for visibility.

Link copied to clipboard
fun useItem(item: SkyblockItem, swapBack: Boolean = true, fromInv: Boolean = false): Boolean

Attempts to swap to and use the specified item. Returns true if successful.

fun useItem(itemSlot: Int, swapBack: Boolean = true, fromInv: Boolean = false): Boolean

Swaps to and uses the specified itemSlot.

fun useItem(name: String, swapBack: Boolean = true, fromInv: Boolean = false, ignoreCase: Boolean = false): Boolean

Attempts to swap to and use the item with the specified name. Returns true if successful.