Skip to content

Cinematic

Info

Available for LabyMod users with version greater than 3.7.7

Overview

It is possible to create an animated camera movement with LabyMod. It is possible to combine this feature with the cinescopes

Requirements

Example code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public void playCinematic( Player player, List<Location> points, long duration ) {
    JsonObject cinematic = new JsonObject();

    // Add points
    JsonArray points = new JsonArray();
    for ( Location location : points ) {
        // Add points
        JsonObject point = new JsonObject();
        point.addProperty( "x", location.getX() );
        point.addProperty( "y", location.getY() );
        point.addProperty( "z", location.getZ() );
        point.addProperty( "yaw", location.getYaw() );
        point.addProperty( "pitch", location.getPitch() );
        point.addProperty( "tilt", 0 ); 
        points.add( point );
    }
    cinematic.add( "points", points );

    // Cinematic duration in ms
    cinematic.addProperty( "duration", duration );

    // Always teleport the player to the start point
    player.teleport( points.get(0) );

    // The player needs to fly for the cinematic
    player.setAllowFlight( true );

    // Play cinematic
    LabyModProtocol.sendLabyModMessage( player, "cinematic", cinematic );
}

Warning

Make sure that the player can fly (Creative mode or Spectator mode)