Interface HeldInteractModule

All Superinterfaces:
InteractModule

public interface HeldInteractModule extends InteractModule
Compared to a regular InteractModule, a HeldInteractModule blocks other modules from using the Interact keybind until it is released/not used anymore.
A HeldInteractModule can be used to drag stuff around. Vivecraft itself uses it to trigger the camera grabbing and bow drawing.
Since:
1.3.0
  • Method Details

    • onHoldTick

      default boolean onHoldTick(LocalPlayer player, InteractionHand hand)
      Called on tick while this module is active and the Interact keybind is still pressed. Useful to process the module state, or cancel early.
      Parameters:
      player - the local player
      hand - the hand that is holding the Interact keybind
      Returns:
      true if this module is still active or false if the Interact keybind should be released early
      Since:
      1.3.0
    • onRelease

      void onRelease(@Nullable LocalPlayer player, InteractionHand hand)
      Counterpart to InteractModule.onPress(LocalPlayer, InteractionHand)
      This is called when the module was active, and the Interact keybind released or onHoldTick(LocalPlayer, InteractionHand) returned false.
      Parameters:
      player - the local player, null if not in a world
      hand - the hand that released the Interact keybind
      Since:
      1.3.0