- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 0
Metadata
VSE provides Spigot metadata on Player objects so other plugins can provide special support for handed interactions or somesuch. If you aren’t sure what metadata is, check the Spigot documentation. The API supports multiple plugins using the same metadata key, so make sure you filter to our specific plugin name (Vivecraft-Spigot-Extension).
Every player has a head and two hands (obviously), each of which have a 6DOF position and rotation. If a player has FBT trackers there is also data for the waist, feet, elbows and knees.
All of the bodypart metadata keys is only available if the server got data for the player, so check if the metadata key is available first.
The following bodyparts have metadata:
- head
- righthand
- lefthand
- waist
- rightfoot
- leftfoot
- rightknee
- leftknee
- rightelbow
- leftelbow
The following values are available for each bodypart (where X needs to be replaced with the bodypart name, ie: head.pos):
| Key(s) | Value | 
|---|---|
| X.pos | Bukkit Locationrepresenting the absolute position in the world of the VR object. Also includes the direction for convenience. | 
| X.dir | Bukkit Vectorrepresenting the forward direction of the VR object. This is gimbal locked; if you want up or right vectors, use therotvalue below. | 
| X.rot | Array of 4 floats, representing a quaternion with the order w,x,y,z. You’ll need aQuaternionclass to deal with this properly, but it’s much more flexible than thedirvalue. As of 1.19.4 Minecraft ships with Joml, whch has one of those, and this plugin also ships it for older versions. | 
There are also some tertiary values so you can determine how to properly handle a particular player.
These are always available if the player is in VR.
The full set of available keys is as follows:
| Key(s) | Value | 
|---|---|
| seated | Booleanrepresenting the player is in seated mode. This mode disables hand tracking and places the VR hands to the sides of the head, to allow for keyboard and mouse play in VR. | 
| height | Floatrepresenting whether the player's calibrated height, which mainly affects how tall they appear to other players. | 
| lefthanded | Booleanwhen true the player holds their mainhand items in the left hand | 
| activehand | Stringrepresenting which bodypart last performed some actions. Currently throwing projectiles such as snowballs. This can either be a hand (leftorright), or any other bodypart (HEAD,RIGHT_FOOT,LEFT_FOOT) |