Class CutsceneEvents

java.lang.Object
net.ixdarklord.coolcatcanvas.api.event.v2.client.CutsceneEvents

public final class CutsceneEvents extends Object
Cutscenes playing on this client, whoever started them: a mod, the server, a command. All fire on the client's main thread; CAMERA fires every frame, the rest on ticks. Previews in the cutscene editor fire MARKER only.
CutsceneEvents.STARTED.register(playback -> music.duck());
CutsceneEvents.KEYFRAME.register((playback, index, keyframe) -> { if (index == 2) roar(); });
CutsceneEvents.ENDED.register((playback, reason) -> music.restore());
A listener is told about every cutscene; tell yours apart by CutscenePlayback.id().
  • Field Details

    • BEFORE_START

      public static final EventInvoker<CutsceneEvents.BeforeStart> BEFORE_START
      Before a cutscene starts, from any source. Returning EventResult.INTERRUPT keeps it from playing: whatever was on screen stays, and a server that asked for it is told it was stopped.
    • STARTED

      public static final EventInvoker<CutsceneEvents.Started> STARTED
      After a cutscene started playing.
    • TICK

      public static final EventInvoker<CutsceneEvents.Tick> TICK
      Every tick a cutscene's clock moves, after it has: not while it or the game is paused. The place for anything that should run alongside it.
    • KEYFRAME

      public static final EventInvoker<CutsceneEvents.Keyframe> KEYFRAME
      As a cutscene's camera reaches one of its keyframes, the first included. Keyframes jumped over by a seek or a skip don't fire.
    • MARKER

      public static final EventInvoker<CutsceneEvents.Marker> MARKER
      As a cutscene passes one of its markers: the cue for a sound, an effect, a shake. Markers jumped over by a seek or a skip don't fire.
    • SUBTITLE

      public static final EventInvoker<CutsceneEvents.Subtitle> SUBTITLE
      As one of a cutscene's subtitles appears: for a voice line that goes with it.
    • PAUSED

      public static final EventInvoker<CutsceneEvents.Paused> PAUSED
      After a cutscene was paused or resumed through its CutscenePlayback. Pausing the game doesn't fire it.
    • CAMERA

      public static final EventInvoker<CutsceneEvents.Camera> CAMERA
      Every frame, with the camera a cutscene is about to use: listeners may hand back another, each seeing what the one before returned. For a camera that reacts to the world: nudged by an explosion, kept out of a wall.
    • BEFORE_SKIP

      public static final EventInvoker<CutsceneEvents.BeforeSkip> BEFORE_SKIP
      Before the player skips a cutscene by holding the skip key. Returning EventResult.INTERRUPT keeps it playing. Not fired for CutscenePlayback.skip(), nor for cutscenes that aren't skippable.
    • ENDED

      public static final EventInvoker<CutsceneEvents.Ended> ENDED
      After a cutscene ended, for any reason: seen through, skipped, stopped, replaced by another, or cut short by leaving the world. The camera is the player's again.