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);// Clear the Minecraft Chatcinematic.add("clear_chat",true);// 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 cinematicLabyModProtocol.sendLabyModMessage(player,"cinematic",cinematic);}publicvoidcancelCinematic(Playerplayer){// Cancel currently playing cinematicLabyModProtocol.sendLabyModMessage(player,"cinematic",newJsonObject());// Empty object}
You will get the following response message with the cinematic key when the player finished the cinematic successfully:
1
2
3
{"completed":true}
Warning
Make sure that the player can fly (Creative mode or Spectator mode)