Files
Construct/docs/API/DataModels.md
T
2026-06-05 17:52:06 +02:00

1.8 KiB

Data Models

The following data models are used to represent the format of the data passed by the API endpoints. More information about the API endpoints can be found in the Endpoints page.

You'll need to include Construct's Data Model definitions in your project to work with the API effectively. These data models define the structure of the data passed to and from the API endpoints. They can be found at packs/BP/scripts/API/ConstructAPIModel.js. Copy the file into your project and import the models as needed.

Instance

An Instance represents a single structure instance in the world, along with its properties and state.

interface Instance {
    name: PROTO.String,
    structureId: PROTO.String,
    isEnabled: PROTO.Boolean,
    dimensionId: PROTO.Optional(PROTO.String),
    location: PROTO.Optional({
        x: PROTO.Float64,
        y: PROTO.Float64,
        z: PROTO.Float64
    }),
    bounds: PROTO.Optional(PROTO.Object({
        min: {
            x: PROTO.Float64,
            y: PROTO.Float64,
            z: PROTO.Float64
        },
        max: {
            x: PROTO.Float64,
            y: PROTO.Float64,
            z: PROTO.Float64
        }
    })),
    currentLayer: PROTO.Int16,
    maxLayer: PROTO.Int16,
    verifier: PROTO.Object({
        isEnabled: PROTO.Boolean,
        trackPlayerDistance: PROTO.Int8,
        particleLifetime: PROTO.Int32
    })
}

Builder

A Builder represents a single builder (Construct's name for Players) in the world, along with its settings and properties.

interface Builder {
    playerId: PROTO.String,
    easyPlace: PROTO.Boolean,
    fastEasyPlace: PROTO.Boolean,
    materialGrabber: PROTO.Boolean,
    materialInstanceName: PROTO.String
}