doPlacement

fun doPlacement(hitResult: BlockHitResult, rotation: Rotation, 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.

Parameters

rotation

rotation used to produce hitResult

See also

Minecraft.startUseItem

fun doPlacement(pos: BlockPos, hand: InteractionHand = InteractionHand.MAIN_HAND, swingMode: SwingMode = SwingMode.DO_NOT_HIDE): Boolean

Places the item in hand at pos against a neighbouring block, rotating silently towards it.

Return

false when there is nothing to place against or the spot is out of reach