### VRRenderingAPI.instance() Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Gets the API instance for interacting with Vivecraft for rendering. ```APIDOC ## instance ### Description Gets the API instance for interacting with Vivecraft for rendering. ### Method static VRRenderingAPI instance() ### Returns The Vivecraft API instance for interacting with Vivecraft's rendering API. ### Since 1.3.0 ``` -------------------------------- ### VRServerAPI.instance() Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/server/VRServerAPI.html Gets the singleton instance of the VRServerAPI for server-side interactions with Vivecraft. ```APIDOC ## Method: instance ### Description Gets API instance for interacting with Vivecraft's server API. ### Signature `static VRServerAPI instance()` ### Returns The Vivecraft API instance for interacting with Vivecraft's server API. ### Since 1.3.0 ``` -------------------------------- ### VRRenderingAPI Instance Source: https://vivecraft.github.io/javadoc/index-all.html Gets the API instance for interacting with Vivecraft for rendering purposes. ```APIDOC ## instance() ### Description Gets the API instance for interacting with Vivecraft for rendering. ### Method Static method ### Endpoint `org.vivecraft.api.client.VRRenderingAPI.instance()` ``` -------------------------------- ### VRServerAPI Instance Source: https://vivecraft.github.io/javadoc/index-all.html Gets the API instance for interacting with Vivecraft's server-side functionalities. ```APIDOC ## instance() ### Description Gets API instance for interacting with Vivecraft's server API. ### Method Static method ### Endpoint `org.vivecraft.api.server.VRServerAPI.instance()` ``` -------------------------------- ### VRClientAPI isVRInitialized Source: https://vivecraft.github.io/javadoc/index-all.html Get whether VR support is currently initialized. ```APIDOC ## isVRInitialized() ### Description Get whether VR support is currently initialized. ### Method Method in interface `org.vivecraft.api.client.VRClientAPI` ``` -------------------------------- ### VRClientAPI Instance Source: https://vivecraft.github.io/javadoc/index-all.html Gets the API instance for interacting with Vivecraft from the client-side, for interactions not related to rendering. ```APIDOC ## instance() ### Description Gets the API instance for interacting with Vivecraft from the client-side, for interactions not related to rendering. ### Method Static method ### Endpoint `org.vivecraft.api.client.VRClientAPI.instance()` ``` -------------------------------- ### Get API Instance Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Retrieves the singleton instance of the VRClientAPI. This is the primary entry point for interacting with Vivecraft's client-side API. ```APIDOC ## instance ### Description Gets the API instance for interacting with Vivecraft from the client-side, for interactions not related to rendering. ### Method `static VRClientAPI` ### Returns The Vivecraft API instance for interacting with Vivecraft's client API. ### Since 1.3.0 ``` -------------------------------- ### isSeated Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Get whether the local player is currently configured to be in seated mode when in VR. ```APIDOC ## isSeated ### Description Get whether the local player is currently configured to be in seated mode when in VR. This doesn't check if VR is active/enabled, it just checks the user setting. ### Method ```java boolean isSeated() ``` ### Returns - `boolean`: Whether the local player is currently in seated mode when in VR. ### Since 1.3.0 ``` -------------------------------- ### getFBTMode Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Gets the mode used for full-body tracking for the local player. ```APIDOC ## getFBTMode ### Description Gets the mode used for full-body tracking for the local player. Will return a sane default value if the local player isn't in VR. ### Method ```java FBTMode getFBTMode() ``` ### Returns - `FBTMode`: The full-body tracking mode currently in-use or some default value if the local player is not in VR. ### Since 1.3.0 ``` -------------------------------- ### getPostTickRoomPose Source: https://vivecraft.github.io/javadoc/index-all.html Gets the VR pose representing the player in the room after the game tick. ```APIDOC ## getPostTickRoomPose() ### Description Gets the VR pose representing the player in the room after the game tick. ### Method Method ### Signature `getPostTickRoomPose()` ### Returns `VRPose` - The room pose after the game tick. ``` -------------------------------- ### getPriority Source: https://vivecraft.github.io/javadoc/index-all.html Gets the priority value of a module, which determines its activation order. ```APIDOC ## getPriority() ### Description The priority value of a module determines when its `InteractModule.isActive(net.minecraft.client.player.LocalPlayer, net.minecraft.world.InteractionHand, net.minecraft.world.phys.Vec3)` method is called compared to other modules. ### Method Method ### Signature `getPriority()` ### Returns `int` - The priority of the module. ``` -------------------------------- ### opposite Source: https://vivecraft.github.io/javadoc/index-all.html Gets the VRBodyPart which is the same type but on the opposite side of the body. ```APIDOC ## opposite() ### Description Gets the VRBodyPart which is the same type but on the opposite side of the body. ### Method `opposite()` ### Response #### Success Response (VRBodyPart) - Returns the opposite VRBodyPart. ``` -------------------------------- ### getLatestRoomPose Source: https://vivecraft.github.io/javadoc/index-all.html Gets the VR pose representing the player in the room after the most recent poll of VR hardware. ```APIDOC ## getLatestRoomPose() ### Description Gets the VR pose representing the player in the room after the most recent poll of VR hardware. ### Method Method ### Signature `getLatestRoomPose()` ### Returns `VRPose` - The latest room pose. ``` -------------------------------- ### getDir Source: https://vivecraft.github.io/javadoc/index-all.html Gets the forward direction that a specific body part is facing. ```APIDOC ## getDir() ### Description Gets the forward direction this body part is facing. ### Method Method ### Signature `getDir()` ### Returns `Vec3` - The forward direction vector. ``` -------------------------------- ### getPreTickWorldPose Source: https://vivecraft.github.io/javadoc/index-all.html Gets the VR pose representing the player in Minecraft world coordinates before the game tick. ```APIDOC ## getPreTickWorldPose() ### Description Gets the VR pose representing the player in Minecraft world coordinates before the game tick. ### Method Method ### Signature `getPreTickWorldPose()` ### Returns `VRPose` - The world pose before the game tick. ``` -------------------------------- ### getPreTickWorldPose Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Gets the VR pose representing the player in world space before the game tick. Returns null if the local player isn't in VR. ```APIDOC ## getPreTickWorldPose ### Description Gets the VR pose representing the player in world space pre-tick. ### Method ```java @Nullable VRPose getPreTickWorldPose() ``` ### Returns - `VRPose`: The VR pose representing the player in world space pre-tick, or `null` if the local player isn't in VR. ### Since 1.3.0 ``` -------------------------------- ### getWorldRenderPose Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Gets the VR pose representing the player in Minecraft world coordinates interpolated for rendering. ```APIDOC ## getWorldRenderPose ### Description Gets the VR pose representing the player in Minecraft world coordinates interpolated for rendering. ### Method ```java @Nullable VRPose getWorldRenderPose() ``` ### Returns - `VRPose`: The VR pose representing the player in Minecraft space post-tick interpolated for rendering, or `null` if the local player isn't in VR. ### Since 1.3.0 ``` -------------------------------- ### isLeftHanded Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Get whether the local player is currently configured to use left-handed mode when in VR. ```APIDOC ## isLeftHanded ### Description Get whether the local player is currently configured to use left-handed mode when in VR. This doesn't check if VR is active/enabled, it just checks the user setting. ### Method ```java boolean isLeftHanded() ``` ### Returns - `boolean`: Whether the local player is playing with left-handed controls when in VR. ### Since 1.3.0 ``` -------------------------------- ### getPostTickWorldPose Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Gets the VR pose representing the player in Minecraft world coordinates after the game tick. This is the pose sent to the server. ```APIDOC ## getPostTickWorldPose ### Description Gets the VR pose representing the player in Minecraft world coordinates after the game tick. This is the pose sent to the server, and also used to calculate the pose in `getWorldRenderPose()`. ### Method ```java @Nullable VRPose getPostTickWorldPose() ``` ### Returns - `VRPose`: The VR pose representing the player in Minecraft space post-tick, or `null` if the local player isn't in VR. ### Since 1.3.0 ``` -------------------------------- ### getId Source: https://vivecraft.github.io/javadoc/index-all.html Gets the unique identifier for this module. ```APIDOC ## getId() ### Description The ID of this module. ### Method Method ### Signature `getId()` ### Returns `String` - The ID of the module. ``` -------------------------------- ### getYaw Source: https://vivecraft.github.io/javadoc/index-all.html Gets the yaw rotation of a body part. ```APIDOC ## getYaw() ### Description Gets the yaw of this body part. ### Method Method ### Signature `getYaw()` ### Returns `float` - The yaw rotation. ``` -------------------------------- ### setupRenderingAtHand (InteractionHand, PoseStack) Source: https://vivecraft.github.io/javadoc/index-all.html Sets the PoseStack to render at the position and rotation of the specified InteractionHand. ```APIDOC ## setupRenderingAtHand (InteractionHand, PoseStack) ### Description Sets the provided `PoseStack` to render at the position of and with the rotation of the provided `InteractionHand`, this assumes the given `stack` to be set to an identity. ### Method Method signature for setting up rendering at a specific hand using PoseStack. ### Parameters - **hand** (InteractionHand) - The hand to align rendering with. - **stack** (PoseStack) - The PoseStack to be modified. ``` -------------------------------- ### getRoll Source: https://vivecraft.github.io/javadoc/index-all.html Gets the roll rotation of a body part. ```APIDOC ## getRoll() ### Description Gets the roll of this body part. ### Method Method ### Signature `getRoll()` ### Returns `float` - The roll rotation. ``` -------------------------------- ### VR Initialization and Status Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Methods to check if VR support is initialized and if the client is currently active in VR. ```APIDOC ## isVRInitialized ### Description Get whether VR support is currently initialized. This is NOT the same as whether the local player is actively in VR, which can instead be checked with `isVRActive()`. ### Method `boolean` ### Returns Whether VR support is initialized. ### Since 1.3.0 ## isVRActive ### Description Get whether the client is actively in VR. ### Method `boolean` ### Returns Whether the client is actively in VR. ### Since 1.3.0 ``` -------------------------------- ### getPitch Source: https://vivecraft.github.io/javadoc/index-all.html Gets the pitch rotation of a body part. ```APIDOC ## getPitch() ### Description Gets the pitch of this body part. ### Method Method ### Signature `getPitch()` ### Returns `float` - The pitch rotation. ``` -------------------------------- ### getHandRenderPos Source: https://vivecraft.github.io/javadoc/index-all.html Gets the rendering position for a specified hand. ```APIDOC ## getHandRenderPos(InteractionHand) ### Description Gets the position that the provided `InteractionHand` renders at. ### Method Method ### Signature `getHandRenderPos(InteractionHand hand)` ### Parameters #### Path Parameters - **hand** (InteractionHand) - Required - The hand to get the render position for. ### Returns `Vec3` - The rendering position of the hand. ``` -------------------------------- ### setupRenderingAtHand (InteractionHand, Matrix4f) Source: https://vivecraft.github.io/javadoc/index-all.html Sets the Matrix4f to render at the position and rotation of the specified InteractionHand. ```APIDOC ## setupRenderingAtHand (InteractionHand, Matrix4f) ### Description Sets the provided `Matrix4f` to render at the position of and with the rotation of the provided `InteractionHand`, this assumes the given `matrix` to be an identity. ### Method Method signature for setting up rendering at a specific hand using Matrix4f. ### Parameters - **hand** (InteractionHand) - The hand to align rendering with. - **matrix** (Matrix4f) - The Matrix4f to be modified. ``` -------------------------------- ### openKeyboard Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Opens Vivecraft's keyboard, doing nothing if the keyboard is already opened or the provided `openKeyboardContext` doesn't result in the keyboard opening. ```APIDOC ## openKeyboard ### Description Opens Vivecraft's keyboard, doing nothing if the keyboard is already opened or the provided `openKeyboardContext` doesn't result in the keyboard opening. Will silently fail if the player isn't in VR. ### Method ```java boolean openKeyboard(OpenKeyboardContext openKeyboardContext) ``` ### Parameters - `openKeyboardContext` (OpenKeyboardContext) - The context to use for opening the keyboard. ### Returns - `boolean`: Whether the keyboard is showing after this method was called. ### Since 1.3.0 ``` -------------------------------- ### getWorldScale Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Get the currently active world scale. ```APIDOC ## getWorldScale ### Description Get the currently active world scale. ### Method ```java float getWorldScale() ``` ### Returns - `float`: The currently active world scale. ### Since 1.3.0 ``` -------------------------------- ### ticksOfHistory() Source: https://vivecraft.github.io/javadoc/index-all.html Gets the number of ticks for which historical data is available. ```APIDOC ## ticksOfHistory() ### Description Gets the number of ticks, historical data is currently available for. ### Method Method signature to retrieve the duration of available historical data. ``` -------------------------------- ### VRRenderingAPI.setupRenderingAtHand(net.minecraft.world.InteractionHand hand, com.mojang.blaze3d.vertex.PoseStack stack) Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Sets the provided PoseStack to render at the position of and with the rotation of the provided InteractionHand, this assumes the given stack to be set to an identity. ```APIDOC ## setupRenderingAtHand ### Description Sets the provided `PoseStack` to render at the position of and with the rotation of the provided `InteractionHand`, this assumes the given `stack` to be set to an identity. ### Method void setupRenderingAtHand(net.minecraft.world.InteractionHand hand, com.mojang.blaze3d.vertex.PoseStack stack) ### Parameters #### Path Parameters - **hand** (net.minecraft.world.InteractionHand) - Description: The hand to set the PoseStack to. - **stack** (com.mojang.blaze3d.vertex.PoseStack) - Description: The PoseStack to be set. ### Since 1.3.0 ``` -------------------------------- ### VRClientAPI isVRActive Source: https://vivecraft.github.io/javadoc/index-all.html Get whether the client is actively in VR. ```APIDOC ## isVRActive() ### Description Get whether the client is actively in VR. ### Method Method in interface `org.vivecraft.api.client.VRClientAPI` ``` -------------------------------- ### getRotation Source: https://vivecraft.github.io/javadoc/index-all.html Gets the quaternion representing the rotation of a body part. ```APIDOC ## getRotation() ### Description Gets the quaternion representing the rotation of this body part. ### Method Method ### Signature `getRotation()` ### Returns `Quaternionf` - The quaternion representing the rotation. ``` -------------------------------- ### Tracker Interface Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/Tracker.html This section details the methods available for implementing the Tracker interface. These methods allow you to define when and how your tracker should process VR data. ```APIDOC ## Tracker Methods ### `processType()` **Description**: Returns the process type for this tracker, determining when and how frequently it is processed. See `Tracker.ProcessType` for options. **Returns**: The process type this tracker should use. ### `isActive(LocalPlayer player)` **Description**: Checks if the tracker is active for the local player. This method is called before other processing methods. **Parameters**: - `player` (LocalPlayer) - The player being checked. Can be `null` when not in a world. **Returns**: `true` if the tracker is active for the specified player, `false` otherwise. ### `idleProcess(LocalPlayer player)` **Description**: Called for the local player regardless of whether the tracker is active. This method is invoked before `activeProcess`, `inactiveProcess`, and `isActive`. **Parameters**: - `player` (LocalPlayer) - The player for whom to perform the idle process. Can be `null` when not in a world. ### `activeProcess(LocalPlayer player)` **Description**: Called for the local player if this tracker is active (i.e., `isActive(LocalPlayer)` returns `true`). This is where the main processing logic for active trackers should reside. **Parameters**: - `player` (LocalPlayer) - The local player for whom to run the tracker. Can be `null` when not in a world, but only if `isActive` also returned `null`. ### `inactiveProcess(LocalPlayer player)` **Description**: Called to reset the tracker's state. This method is invoked whenever `isActive(LocalPlayer)` returns `false`. **Parameters**: - `player` (LocalPlayer) - The local player. Can be `null` when not in a world, but only if `isActive` also returned `null`. ``` -------------------------------- ### getPos Source: https://vivecraft.github.io/javadoc/index-all.html Gets the world space position of a body part. ```APIDOC ## getPos() ### Description Gets the world space position for this body part. ### Method Method ### Signature `getPos()` ### Returns `Vec3` - The world space position. ``` -------------------------------- ### VRRenderingAPI.setupRenderingAtHand(net.minecraft.world.InteractionHand hand, org.joml.Matrix4f matrix) Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Sets the provided Matrix4f to render at the position of and with the rotation of the provided InteractionHand, this assumes the given matrix to be an identity. ```APIDOC ## setupRenderingAtHand ### Description Sets the provided `Matrix4f` to render at the position of and with the rotation of the provided `InteractionHand`, this assumes the given `matrix` to be an identity. ### Method void setupRenderingAtHand(net.minecraft.world.InteractionHand hand, org.joml.Matrix4f matrix) ### Parameters #### Path Parameters - **hand** (net.minecraft.world.InteractionHand) - Description: The hand to set the Matrix4f to. - **matrix** (org.joml.Matrix4f) - Description: The Matrix4f to be set. ### Since 1.3.0, Minecraft 1.20.5 ``` -------------------------------- ### VRClientAPI Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/package-summary.html The main interface for interacting with the local player using Vivecraft from client code. ```APIDOC ## VRClientAPI ### Description The main interface for interacting with the local player using Vivecraft from client code. ### Methods This interface provides access to various client-side functionalities. Specific methods are detailed in its implementation or related classes. ``` -------------------------------- ### VRPose Interface Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRPose.html This section details the methods available in the VRPose interface for retrieving VR player pose data. ```APIDOC ## getBodyPartData ### Description Gets the pose data for a specific body part. ### Method Signature `VRBodyPartData getBodyPartData(VRBodyPart vrBodyPart)` ### Parameters * `vrBodyPart` (VRBodyPart) - The body part to get the pose data for. ### Returns * `VRBodyPartData` - The pose data for the specified body part, or `null` if the body part is not available with the current FBTMode. ### Since 1.3.0 ## getFBTMode ### Description Gets the full-body tracking mode the player was using when the pose was created. ### Method Signature `FBTMode getFBTMode()` ### Returns * `FBTMode` - The full-body tracking mode. ### Since 1.3.0 ## getHand ### Description Gets the body part data for a given hand. ### Method Signature `VRBodyPartData getHand(net.minecraft.world.InteractionHand hand)` ### Parameters * `hand` (net.minecraft.world.InteractionHand) - The interaction hand to get data for. ### Returns * `VRBodyPartData` - The body part data for the specified hand. ### Since 1.3.0 ## getHead ### Description Gets the body part pose data for the head. ### Method Signature `VRBodyPartData getHead()` ### Returns * `VRBodyPartData` - Body part pose data for the head. ### Since 1.3.0 ## getMainHand ### Description Gets the body part data for the main-hand. ### Method Signature `VRBodyPartData getMainHand()` ### Returns * `VRBodyPartData` - The main-hand's body part data. ### Since 1.3.0 ## getOffHand ### Description Gets the body part data for the off-hand. ### Method Signature `VRBodyPartData getOffHand()` ### Returns * `VRBodyPartData` - The off-hand's body part data. ### Since 1.3.0 ## isLeftHanded ### Description Gets whether the player was using left-handed mode when the pose was created. ### Method Signature `boolean isLeftHanded()` ### Returns * `boolean` - `true` if the player was using left-handed mode, `false` otherwise. ### Since 1.3.0 ## isSeated ### Description Gets whether the player was in seated mode when the pose was created. ### Method Signature `boolean isSeated()` ### Returns * `boolean` - `true` if the player was in seated mode, `false` otherwise. ### Since 1.3.0 ``` -------------------------------- ### VRBodyPart Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRBodyPart.html Methods available for the VRBodyPart enum. ```APIDOC ## Method Summary Modifier and Type | Method | Description ---|---|--- `boolean` | `availableInMode(FBTMode fbtMode)` | Whether this body part type is available in the provided full-body tracking mode. `static VRBodyPart` | `fromInteractionHand(net.minecraft.world.InteractionHand hand)` | Gets the corresponding VRBodyPart to the provided InteractionHand `boolean` | `isFoot()` | Checks if `this` VRBodyPart is a foot `boolean` | `isHand()` | Checks if `this` VRBodyPart is a hand `VRBodyPart` | `opposite()` | Gets the VRBodyPart which is the same type but on the opposite side of the body. `static VRBodyPart` | `valueOf(String name)` | Returns the enum constant of this class with the specified name. `static VRBodyPart[]` | `values()` | Returns an array containing the constants of this enum class, in the order they are declared. ``` -------------------------------- ### VRPose isSeated Source: https://vivecraft.github.io/javadoc/index-all.html Gets whether the player was in seated mode when the pose was created. ```APIDOC ## isSeated() ### Description Gets whether the player was in seated mode when the pose was created. ### Method Method in interface `org.vivecraft.api.data.VRPose` ``` -------------------------------- ### Interface: VivecraftClientRegistrationEvent Source: https://vivecraft.github.io/javadoc/index-all.html The event fired on the client for registering trackers and interact modules with Vivecraft. ```APIDOC ## VivecraftClientRegistrationEvent ### Description The event that is fired on the client for registering trackers and interact modules with Vivecraft. ### Interface org.vivecraft.api.client.event ``` -------------------------------- ### itemInUse Method Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/ItemInUseTracker.html This method is called for the client player to determine if the tracker should prevent the vanilla use key from being released. Returning true indicates that the item should remain in use. ```APIDOC ## itemInUse ### Description Called for the client player, to check if this tracker is currently causing the item to be used to not release the use key. In other words, if you want the item currently being held to act as the use key being held, one should call the use item function, then return true from this method while the item should still remain used. ### Method ```java boolean itemInUse(net.minecraft.client.player.LocalPlayer player) ``` ### Parameters #### Path Parameters - **player** (net.minecraft.client.player.LocalPlayer) - Required - The local player which is running this tracker. ### Returns - **boolean** - Whether the item should remain in use. ### Since 1.3.0 ``` -------------------------------- ### VRAPI Instance Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/VRAPI.html Retrieves the singleton instance of the VRAPI for interacting with Vivecraft's common API. ```APIDOC ## instance ### Description Gets API instance for interacting with Vivecraft's common API. ### Method static VRAPI ### Returns - The Vivecraft API instance for interacting with Vivecraft's common API. ### Since 1.3.0 ``` -------------------------------- ### getCurrentRenderPass Source: https://vivecraft.github.io/javadoc/index-all.html Gets the current render pass being processed by the VR rendering system. ```APIDOC ## getCurrentRenderPass() ### Description Gets the current render pass. ### Method Method ### Signature `getCurrentRenderPass()` ### Returns `RenderPass` - The current render pass. ``` -------------------------------- ### VRPose isLeftHanded Source: https://vivecraft.github.io/javadoc/index-all.html Gets whether the player was using left-handed mode when the pose was created. ```APIDOC ## isLeftHanded() ### Description Gets whether the player was using left-handed mode when the pose was created. ### Method Method in interface `org.vivecraft.api.data.VRPose` ``` -------------------------------- ### Enum Constants and Methods Source: https://vivecraft.github.io/javadoc/index-all.html Documentation for static methods 'valueOf' and 'values' for various enum classes within the Vivecraft API. ```APIDOC ## valueOf(String) ### Description Returns the enum constant of this class with the specified name. ### Method Static method ### Parameters - **name** (String) - The name of the enum constant to return. ### Class - org.vivecraft.api.client.data.CloseKeyboardContext - org.vivecraft.api.client.data.OpenKeyboardContext - org.vivecraft.api.client.data.RenderPass - org.vivecraft.api.client.Tracker.ProcessType - org.vivecraft.api.data.FBTMode - org.vivecraft.api.data.VRBodyPart ``` ```APIDOC ## values() ### Description Returns an array containing the constants of this enum class, in the order they are declared. ### Method Static method ### Class - org.vivecraft.api.client.data.CloseKeyboardContext - org.vivecraft.api.client.data.OpenKeyboardContext - org.vivecraft.api.client.data.RenderPass - org.vivecraft.api.client.Tracker.ProcessType - org.vivecraft.api.data.FBTMode - org.vivecraft.api.data.VRBodyPart ``` -------------------------------- ### RenderPass Static Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/data/RenderPass.html Utility methods for working with RenderPass constants. ```APIDOC ## Static Methods Modifier and Type | Method | Description ---|---|--- `static boolean` | `isFirstPerson(RenderPass pass)` | Returns whether the provided RenderPass is rendered from the player's perspective. `static boolean` | `isThirdPerson(RenderPass pass)` | Returns whether the provided RenderPass is rendered from a third-person perspective. `static boolean` | `renderPlayer(RenderPass pass)` | Returns whether the RenderPass is supposed to render the player model. `static RenderPass` | `valueOf(String name)` | Returns the enum constant of this class with the specified name. `static RenderPass[]` | `values()` | Returns an array containing the constants of this enum class, in the order they are declared. ``` -------------------------------- ### onPress Source: https://vivecraft.github.io/javadoc/index-all.html Use this to do an action when the Interact keybind is being pressed. ```APIDOC ## onPress(LocalPlayer, InteractionHand) ### Description Use this to do an action when the Interact keybind is being pressed. ### Method `onPress(LocalPlayer player, InteractionHand hand)` ### Parameters #### Path Parameters - **player** (LocalPlayer) - Required - The local player. - **hand** (InteractionHand) - Required - The hand performing the interaction. ``` -------------------------------- ### Enum Constant: VANILLA Source: https://vivecraft.github.io/javadoc/index-all.html Represents the Vanilla view rendering mode. ```APIDOC ## VANILLA ### Description Renders the Vanilla view. ### Enum org.vivecraft.api.client.data.RenderPass ``` -------------------------------- ### Enum Constants Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/data/OpenKeyboardContext.html Represents different contexts for opening the VR keyboard. ```APIDOC ## Enum Constants ### `FOCUS` Only opens the keyboard if the user has configured to open the keyboard when a text box becomes focused. ### `FOCUS_CHAT` Only opens the keyboard if the user has configured to open the keyboard when a text box or chat becomes focused. ### `FORCE` Will open the keyboard no matter the situation. ``` -------------------------------- ### ticksOfHistory Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRPoseHistory.html Gets the number of ticks for which historical data is currently available. This value will not exceed 200. ```APIDOC ## ticksOfHistory ### Description Gets the number of ticks, historical data is currently available for. The number returned by this method will never be higher than 200, the maximum number of ticks Vivecraft holds data for, however, it can be lower than 200. ### Returns - `int`: The number of ticks, historical data is currently available for. ### Since 1.3.0 ``` -------------------------------- ### VRRenderingAPI Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/package-summary.html The main interface for interacting with Vivecraft from rendering code. ```APIDOC ## VRRenderingAPI ### Description The main interface for interacting with Vivecraft from rendering code. ### Methods This interface is intended for use within rendering pipelines to access Vivecraft-specific rendering features. ``` -------------------------------- ### Interface: VRAPI Source: https://vivecraft.github.io/javadoc/index-all.html The main interface for interacting with Vivecraft from common code. ```APIDOC ## VRAPI ### Description The main interface for interacting with Vivecraft from common code. ### Interface org.vivecraft.api ``` -------------------------------- ### netMovement Source: https://vivecraft.github.io/javadoc/index-all.html Gets the net movement in world space between the most recent and oldest VRPose within a specified tick limit. ```APIDOC ## netMovement(VRBodyPart, int) ### Description Gets the net movement in world space between the most recent VRPose in this instance and the oldest VRPose that can be retrieved, going no farther back than `maxTicksBack`. ### Method `netMovement(VRBodyPart vrBodyPart, int maxTicksBack)` ### Parameters #### Path Parameters - **vrBodyPart** (VRBodyPart) - Required - The body part to track movement for. - **maxTicksBack** (int) - Required - The maximum number of ticks to look back for the oldest VRPose. ### Response #### Success Response (double) - Returns the net movement in world space. ``` ```APIDOC ## netMovement(VRBodyPart, int, boolean) ### Description Gets the net movement between the most recent VRPose in this instance and the oldest VRPose that can be retrieved, going no farther back than `maxTicksBack`. ### Method `netMovement(VRBodyPart vrBodyPart, int maxTicksBack, boolean includeCurrent)` ### Parameters #### Path Parameters - **vrBodyPart** (VRBodyPart) - Required - The body part to track movement for. - **maxTicksBack** (int) - Required - The maximum number of ticks to look back for the oldest VRPose. - **includeCurrent** (boolean) - Required - Whether to include the current VRPose in the calculation. ### Response #### Success Response (double) - Returns the net movement. ``` -------------------------------- ### VRBodyPart Enum Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRBodyPart.html Provides utility methods for working with VRBodyPart constants. ```APIDOC ## Method Details ### values public static VRBodyPart[] values() Returns an array containing the constants of this enum class, in the order they are declared. Returns: an array containing the constants of this enum class, in the order they are declared ### valueOf public static VRBodyPart valueOf(String name) Returns the enum constant of this class with the specified name. The string must match _exactly_ an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.) Parameters: `name` - the name of the enum constant to be returned. Returns: the enum constant with the specified name Throws: `IllegalArgumentException` - if this enum class has no constant with the specified name `NullPointerException` - if the argument is null ### opposite public VRBodyPart opposite() Gets the VRBodyPart which is the same type but on the opposite side of the body. VRBodyParts that don't have an opposite counterpart will return itself. Returns: the opposite VRBodyPart Since: 1.3.0 ### fromInteractionHand public static VRBodyPart fromInteractionHand(net.minecraft.world.InteractionHand hand) Gets the corresponding VRBodyPart to the provided InteractionHand. Parameters: `hand` - InteractionHand to convert Returns: VRBodyPart that corresponds to the given InteractionHand Since: 1.3.0 ### availableInMode public boolean availableInMode(FBTMode fbtMode) Whether this body part type is available in the provided full-body tracking mode. Parameters: `fbtMode` - The full-body tracking mode to check. Returns: Whether this body part has available data in the provided mode. Since: 1.3.0 ### isFoot public boolean isFoot() Checks if `this` VRBodyPart is a foot. Returns: Whether this body part is a foot. Since: 1.3.0 ### isHand public boolean isHand() Checks if `this` VRBodyPart is a hand. Returns: Whether this body part is a hand. Since: 1.3.0 ``` -------------------------------- ### VRRenderingAPI.getCurrentRenderPass() Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Gets the current render pass. This method's return value is only valid if this method was called while rendering. ```APIDOC ## getCurrentRenderPass ### Description Gets the current render pass. This method's return value is only valid if this method was called while rendering. ### Method RenderPass getCurrentRenderPass() ### Returns The current render pass Vivecraft is performing. ### Since 1.3.0 ``` -------------------------------- ### Enum Constants Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/data/CloseKeyboardContext.html Defines the possible contexts for closing the VR keyboard. ```APIDOC ## Enum Constant Summary Enum Constants Enum Constant Description `ACTION_COMPLETE` Will close the keyboard if the user has configured to close the keyboard when an action has been completed. `FORCE` Will close the keyboard no matter the situation. ``` -------------------------------- ### VRClientAPI.addClientRegistrationHandler Source: https://vivecraft.github.io/javadoc/index-all.html Registers a handler to be called when Vivecraft client registration events occur. This allows mods to react to client initialization. ```APIDOC ## addClientRegistrationHandler(Consumer handler) ### Description Registers a handler, which consumes a `VivecraftClientRegistrationEvent`. ### Method `addClientRegistrationHandler` ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **handler** (Consumer) - Required - The consumer to register for client registration events. ``` -------------------------------- ### getHistoricalData (ticksBack) Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRPoseHistory.html Gets the pose data from a specified number of ticks in the past, in world space. Returns null if data is unavailable. ```APIDOC ## getHistoricalData ### Description Gets the pose from `ticksBack` ticks back in world space, or `null` if such data isn't available. ### Parameters - `ticksBack` (int) - Ticks back to retrieve data from. ### Returns - `VRPose`: A `VRPose` instance from `ticksBack` ticks ago, or `null` if that data isn't available. ### Throws - `IllegalArgumentException`: Thrown when `ticksBack` is outside the range [0,200]. ### Since 1.3.0 ``` -------------------------------- ### Event Handler Registration Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Registers a handler to receive Vivecraft client registration events, allowing for custom module registration. ```APIDOC ## addClientRegistrationHandler ### Description Registers a handler, which consumes a `VivecraftClientRegistrationEvent`. With this one can register custom `Tracker` and `InteractModule` for the local player. Needs to be called before the game loop starts. ### Method `void` ### Parameters #### Parameters - `handler` (Consumer) - Required - handler to add. ### Throws `IllegalStateException` - When called after the handlers were already processed. ### Since 1.3.0 ``` -------------------------------- ### getHistoricalData (ticksBack, playerPositionRelative) Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRPoseHistory.html Gets the pose data from a specified number of ticks in the past, with an option to calculate relative to the player's position. ```APIDOC ## getHistoricalData ### Description Gets the pose from `ticksBack` ticks back, or `null` if such data isn't available. ### Parameters - `ticksBack` (int) - Ticks back to retrieve data from. - `playerPositionRelative` (boolean) - If true, calculations are done relative to the player; otherwise, in world space. ### Returns - `VRPose`: A `VRPose` instance from `ticksBack` ticks ago, or `null` if that data isn't available. ### Throws - `IllegalArgumentException`: Thrown when `ticksBack` is outside the range [0,200]. ### Since 1.3.0 ``` -------------------------------- ### sendHapticPulse (ServerPlayer, VRBodyPart, float, float, float, float) Source: https://vivecraft.github.io/javadoc/index-all.html Sends a haptic pulse with customizable parameters for the specified VRBodyPart to the given player. ```APIDOC ## sendHapticPulse (ServerPlayer, VRBodyPart, float, float, float, float) ### Description Sends a haptic pulse (vibration/rumble) for the specified VRBodyPart, if possible, to the given player with customizable parameters. ### Method Method signature for sending a detailed haptic pulse. ### Parameters - **player** (ServerPlayer) - The player to send the haptic pulse to. - **bodyPart** (VRBodyPart) - The body part to apply the haptic pulse to. - **strength** (float) - The strength of the haptic pulse. - **frequency** (float) - The frequency of the haptic pulse. - **duration** (float) - The duration of the haptic pulse. - **amplitude** (float) - The amplitude of the haptic pulse. ``` -------------------------------- ### getHead Source: https://vivecraft.github.io/javadoc/index-all.html Retrieves the pose data for the player's head. ```APIDOC ## getHead() ### Description Gets the body part pose data for the head. ### Method Method ### Signature `getHead()` ### Returns `VRBodyPartData` - The pose data for the head. ``` -------------------------------- ### VRRenderingAPI.isVanillaRenderPass() Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Gets whether the current render pass is a vanilla render pass. This method's return value is only valid if this method was called while rendering. ```APIDOC ## isVanillaRenderPass ### Description Gets whether the current render pass is a vanilla render pass. This method's return value is only valid if this method was called while rendering. ### Method boolean isVanillaRenderPass() ### Returns Whether the current render pass is a vanilla render pass. ### Since 1.3.0 ``` -------------------------------- ### VRRenderingAPI.getHandRenderPos(net.minecraft.world.InteractionHand hand) Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRRenderingAPI.html Gets the position that the provided InteractionHand renders at. Unlike VRPose.getHand(InteractionHand) from VRClientAPI.getWorldRenderPose(), this returns a reasonable, default value for seated mode. ```APIDOC ## getHandRenderPos ### Description Gets the position that the provided `InteractionHand` renders at. Unlike `VRPose.getHand(InteractionHand)` from `VRClientAPI.getWorldRenderPose()`, this returns a reasonable, default value for seated mode. ### Method net.minecraft.world.phys.Vec3 getHandRenderPos(net.minecraft.world.InteractionHand hand) ### Parameters #### Path Parameters - **hand** (net.minecraft.world.InteractionHand) - Description: The hand to get the rendering position of. ### Returns The rendering position for the provided hand. ### Since 1.3.0 ``` -------------------------------- ### Interface: VRPoseHistory Source: https://vivecraft.github.io/javadoc/index-all.html Represents the pose history of the VR player. ```APIDOC ## VRPoseHistory ### Description Represents the pose history of the VR player. ### Interface org.vivecraft.api.data ``` -------------------------------- ### onPress() Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/InteractModule.html Executes the primary action of the module when the Interact keybind is pressed. This method is only called if `isActive()` returned `true` and no preceding module in the processing order also returned `true` from its `isActive()` method. ```APIDOC ## Method: onPress `boolean onPress(net.minecraft.client.player.LocalPlayer player, net.minecraft.world.InteractionHand hand)` Use this to do an action when the Interact keybind is being pressed. This is only called when `isActive(net.minecraft.client.player.LocalPlayer, net.minecraft.world.InteractionHand, net.minecraft.world.phys.Vec3)` returned `true` and no other module did so before this one. Parameters: `player` - the local player `hand` - the hand that triggered the press ``` -------------------------------- ### sendHapticPulse (ServerPlayer, VRBodyPart, float) Source: https://vivecraft.github.io/javadoc/index-all.html Sends a haptic pulse at full strength with 160 Hz for the specified VRBodyPart to the given player. ```APIDOC ## sendHapticPulse (ServerPlayer, VRBodyPart, float) ### Description Sends a haptic pulse (vibration/rumble) at full strength with 160 Hz for the specified VRBodyPart, if possible, to the given player. ### Method Method signature for sending a basic haptic pulse. ### Parameters - **player** (ServerPlayer) - The player to send the haptic pulse to. - **bodyPart** (VRBodyPart) - The body part to apply the haptic pulse to. - **strength** (float) - The strength of the haptic pulse (assumed to be full strength in this overload). ``` -------------------------------- ### Enum Class: VRBodyPart Source: https://vivecraft.github.io/javadoc/index-all.html Corresponds to the different tracked device roles supported by Vivecraft. ```APIDOC ## VRBodyPart ### Description Corresponds to the different tracked device roles that are supported by Vivecraft. ### Enum Class org.vivecraft.api.data ``` -------------------------------- ### values() Method Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/data/CloseKeyboardContext.html Returns an array containing all the constants of the CloseKeyboardContext enum. ```APIDOC ## Method Summary Modifier and Type Method Description `static CloseKeyboardContext[]` `values()` Returns an array containing the constants of this enum class, in the order they are declared. ``` -------------------------------- ### Tracker Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/package-summary.html A tracker is an object that is run for the local player during the game tick or before rendering a frame only if they are in VR. ```APIDOC ## Tracker ### Description A tracker is an object that is run for the local player during the game tick or before rendering a frame only if they are in VR. ### Processing Trackers are processed based on the `Tracker.ProcessType`. ``` -------------------------------- ### Player Pose Information Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Methods to retrieve the player's VR pose in different states (latest poll, post-tick, pre-tick) and coordinate systems (room, world). ```APIDOC ## getLatestRoomPose ### Description Gets the VR pose representing the player in the room after the most recent poll of VR hardware. ### Method `@Nullable VRPose` ### Returns The most up-to-date VR pose representing the player in the room, or `null` if the local player isn't in VR. ### Since 1.3.0 ## getPostTickRoomPose ### Description Gets the VR pose representing the player in the room after the game tick. Note that this pose is gathered AFTER mod loaders' post-tick events. ### Method `@Nullable VRPose` ### Returns The VR pose representing the player in the room post-tick, or `null` if the local player isn't in VR. ### Since 1.3.0 ## getPreTickWorldPose ### Description Gets the VR pose representing the player in Minecraft world coordinates before the game tick. If you're unsure which `VRPose` method to use, you very likely want to use this one. Note that this pose is gathered BEFORE mod loaders' pre-tick events. ### Method `@Nullable VRPose` ### Returns The VR pose representing the player in the world pre-tick, or `null` if the local player isn't in VR. ### Since 1.3.0 ``` -------------------------------- ### VRBodyPartData Methods Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRBodyPartData.html This section details the methods available on the VRBodyPartData interface for retrieving spatial and rotational information. ```APIDOC ## VRBodyPartData Interface Represents the data for a body part, or a device usually tied to a body part in VR, such as the HMD or a controller. ### Methods * **getPos()**: Gets the world space position for this body part. * Returns: The position of this body part in Minecraft world coordinates. * Since: 1.3.0 * **getDir()**: Gets the forward direction this body part is facing. * Returns: The forward direction of this body part. * Since: 1.3.0 * **getPitch()**: Gets the pitch of this body part. * Returns: The pitch of this body part in radians. * Since: 1.3.0 * **getYaw()**: Gets the yaw of this body part. * Returns: The yaw of this body part in radians. * Since: 1.3.0 * **getRoll()**: Gets the roll of this body part. * Returns: The roll of this body part in radians. * Since: 1.3.0 * **getRotation()**: Gets the quaternion representing the rotation of this body part. * Returns: The quaternion representing the rotation of this body part. * Since: 1.3.0 ``` -------------------------------- ### getFBTMode (VRPose) Source: https://vivecraft.github.io/javadoc/index-all.html Retrieves the full-body tracking mode that was active when the pose was created. ```APIDOC ## getFBTMode() ### Description Gets the full-body tracking mode the player was using when the pose was created. ### Method Method ### Signature `getFBTMode()` ### Returns `FBTMode` - The full-body tracking mode used when the pose was created. ``` -------------------------------- ### VRBodyPart Enum Constants Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/data/VRBodyPart.html Represents the different tracked device roles supported by Vivecraft. ```APIDOC ## Enum Constants Enum Constant | Description ---|--- `HEAD` | corresponds to the player's headset, so it is at their eye position `LEFT_ELBOW` | `LEFT_FOOT` | `LEFT_KNEE` | `MAIN_HAND` | Main hand of the player, this is the hand the player points with. `OFF_HAND` | `RIGHT_ELBOW` | `RIGHT_FOOT` | `RIGHT_KNEE` | `WAIST` | ``` -------------------------------- ### closeKeyboard Source: https://vivecraft.github.io/javadoc/org/vivecraft/api/client/VRClientAPI.html Closes Vivecraft's keyboard. ```APIDOC ## closeKeyboard ### Description Closes Vivecraft's keyboard. ### Method ```java boolean closeKeyboard(CloseKeyboardContext closeKeyboardContext) ``` ### Parameters - `closeKeyboardContext` (CloseKeyboardContext) - The context to use for closing the keyboard. ### Since 1.3.0 ```