publicvoidplayCinematic(Playerplayer,List<Location>points,longduration){JsonObjectcinematic=newJsonObject();// Add pointsJsonArraypoints=newJsonArray();for(Locationlocation:points){// Add pointsJsonObjectpoint=newJsonObject();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 mscinematic.addProperty("duration",duration);// Always teleport the player to the start pointplayer.teleport(points.get(0));// The player needs to fly for the cinematicplayer.setAllowFlight(true);// Play cinematicLabyModPlugin.getInstance().sendServerMessage(player,"cinematic",cinematic);}
Warning
Make sure that the player can fly (Creative mode or Spectator mode)