Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.
hammy3502 edited this page Apr 19, 2022 · 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, 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.

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