Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
hammy3502 edited this page Mar 7, 2023 · 5 revisions

The IVRAPI interface contains the upper-level of the API. It contains several functions:

getVersionString(): Returns the version String for the API. As of writing, this returns "1.1.0".

apiActive(PlayerEntity player): Whether or not the VRAPI is active and running on both the logical side and client side.

getVersionArray(): Returns the version as an array. As of writing, this returns {1, 1, 0}

getVRPlayer(PlayerEntity player): Gets an instance of IVRPlayer for the specified player based on their tick data, or null if the player is not in VR (or if this is being run server-side, null may also be received if the server hasn't received VR info yet).

getPreTickVRPlayer(): Gets an instance of IVRPlayer based on the local player's tick data before the game tick. Only available client side!

getRenderVRPlayer(): Gets an instance of IVRPlayer based on the local player's data just before the frame is rendered. Useful for custom rendering, and available only on the client!

getPreTickRoomVRPlayer(): Gets an instance of IVRPlayer based on the local player's data relative to the room they're physically in rather than the world. This data is from before the game tick, and available client-side only!

getPostTickRoomVRPlayer(): Gets an instance of IVRPlayer based on the local player's data relative to the room they're physically in rather than the world. This data is from after the game tick, and available client-side only!

playerInVR(PlayerEntity player): Returns true if the player is in VR, or false if they are not. Runs more quickly than getVRPlayer(player) != null.

triggerHapticPulse(int controllerNum, float durationSeconds, @Nullable ServerPlayerEntity player): Triggers a haptic pulse on the specified controller numbered controllerNum for durationSeconds seconds. If the player argument is specified and the code is server-side, a packet will be sent to the client to trigger the specified haptic pulse.

triggerHapticPulse(int controllerNum, float durationSeconds, float frequency, float amplitude, float delaySeconds, @Nullable ServerPlayerEntity player): A more advanced version of the above triggerHapticPulse function, that allows specifying the frequency and amplitude of the rumble/haptic pulse. The haptics begin after delaySeconds sesconds.

isSeated(Player player): Whether the given player is currently playing using seated mode.

isLeftHanded(Player player): Whether the given player is using "Reverse Hands" in Vivecraft.

Getting Started

Getting Started

Logical Sides and Ping Limitations

Version Compatibility

API Interface

IVRAPI

Data Interfaces

IVRPlayer

IVRData

Dev Mode

Dev Mode

Removed

VRPlayerTickEvent (Removed as of 2.0.0 Pre-Release 1)

Clone this wiki locally