doPlacement

fun doPlacement(hitResult: BlockHitResult, hand: InteractionHand = InteractionHand.MAIN_HAND, onPlacementSuccess: () -> Boolean = { true }, onItemUseSuccess: () -> Boolean = { true }, swingMode: SwingMode = SwingMode.DO_NOT_HIDE)

Simulated net.minecraft.world.phys.HitResult.Type.BLOCK branch in vanilla

This function does not perform the surrounding checks from net.minecraft.client.Minecraft.startUseItem, such as whether the game mode is destroying a block, the player's hands are busy, or the held item is enabled. Callers should perform the applicable checks before calling this function.

See also

Minecraft.startUseItem