-
Notifications
You must be signed in to change notification settings - Fork 2
IVRAPI
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, or null if the player is not in VR.
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.
public void 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.
Logical Sides and Ping Limitations
VRPlayerTickEvent (Removed as of 2.0.0 Pre-Release 1)