Skip to content

KubeJS Integration

mortuusars edited this page May 11, 2024 · 2 revisions

Exposure currently adds three events for use in KubeJS scripts:

ExposureEvents.shutterOpening

[client] [server] - cancelable

  • Fired when Camera tries to take a photo. Can be canceled to prevent capturing an image.
  • Client-side event wouldn't fire if server-side event was canceled.
  • If canceled only on the client - shutter would be opened, but the image would not be captured and frame wouldn't be added to a film.

Available methods/properties:

  • getEntity()/getPlayer() - player that used a Camera
  • getCameraStack() - Camera item stack that was used
  • int getLightLevel() - light level at the player position
  • boolean shouldFlashFire() - if the flash will attempt to fire (can fail due to obstructions)

ExposureEvents.modifyFrameData

[server]

  • Can be used to add additional data to the frame or modify existing data. This data can be used in advancements or quests afterward.

Available methods/properties:

  • getEntity()/getPlayer() - player that used a Camera
  • getCameraStack() - Camera item stack that was used
  • getFrame() - NBT-tag with frame data
  • getEntitiesInFrame() - list of entities that were captured on the frame

ExposureEvents.frameAdded

[server]

  • Fired at the very end of a shot, after frame is added to a film.

Available methods/properties:

  • getEntity()/getPlayer() - player that used a Camera
  • getCameraStack() - Camera item stack that was used
  • getFrame() - NBT-tag with frame data

Same events are available as regular java forge/fabric events