Interface HitboxVRMovementInfoBuilder

All Known Implementing Classes:
HitboxVRMovementInfoBuilderImpl

public interface HitboxVRMovementInfoBuilder
Creates info for determining movement in VR for use with the RelativeHitboxInfoBuilders used for creating BlockBasedImmersiveBuilders. This info allows for running actionConsumer(BiConsumer) when the movement within this hitbox reaches the criteria defined in this interface. Note that this does NOT call regular hitbox interaction code, meaning your set HitboxInteractHandler will NOT be called!
  • Method Details

    • create

      static HitboxVRMovementInfoBuilder create()
      Starts creation of a HitboxVRMovementInfo.
      Returns:
      A builder object to begin creation.
    • axis

      HitboxVRMovementInfoBuilder axis(@Nullable net.minecraft.core.Direction.Axis axis)
      Sets the axis of movement for the HitboxVRMovementInfo.
      Parameters:
      axis - The axis of movement to detect motion on, or null to detect on all axes combined.
      Returns:
      Builder object.
    • threshold

      HitboxVRMovementInfoBuilder threshold(double threshold)
      Sets the amount of distance that should be covered within a game tick for the movement to have succeeded.
      One positive and one negative threshold can be set. Future sets will override the value already there. For example, setting the thresholds 0.03, -0.02, and 0.02, will have the thresholds for movement detection be 0.02 positive movement and 0.02 negative movement.
      Setting a threshold of 0 will clear both the positive and negative thresholds.
      Parameters:
      threshold - Threshold of movement.
      Returns:
      Builder object.
    • controllerMode

      Sets which controllers are detected for meeting the threshold of movement.
      Parameters:
      controllerMode - Which controller(s) should be watched for meeting the movement threshold.
      Returns:
      Builder object.
    • actionConsumer

      HitboxVRMovementInfoBuilder actionConsumer(BiConsumer<BuiltBlockBasedImmersiveInfo<?>, List<net.minecraft.world.InteractionHand>> actionConsumer)
      Sets a callback to run when the threshold is met.
      Parameters:
      actionConsumer - The callback to run when the threshold is met, taking the info and the hand(s) that met the threshold.
      Returns:
      Builder object.
    • build

      Builds this builder into a HitboxVRMovementInfo.
      Returns:
      The built HitboxVRMovementInfo.