Colshape
@vimp-mp/types 2.0.1Server-side trigger volume returned by vimp.colshapes.create*.
Detection (player enter/exit) is performed authoritatively by the server on each player position update; scripts only observe the results via playerEnterColshape / playerExitColshape events.
playersInside is a live JS-side cache updated by those same events; reading it never round-trips to the server.
interface Colshape extends StreamSyncedMetaMembers
dimension
dimension: numberVirtual world. Detection (playerEnterColshape/playerExitColshape) runs only for players in the same dimension. A player in another dimension does not generate an event even while physically inside.
id
readonly id: numberServer-assigned colshape identifier.
isExists
readonly isExists: booleanWhether the colshape is still registered with the server runtime.
key
readonly key: string | undefinedApplication key supplied at creation.
playersInside
readonly playersInside: readonly Array<Player>Players currently inside this volume (server-authoritative).
position
position: Vec3Trigger volume centre. Writing it moves the colshape server-side and re-streams the new geometry to every client.
type
readonly type: ColshapeTypeGeometric shape selected by the creation method.
deleteStreamSyncedMeta
deleteStreamSyncedMeta(key: string): voidDeletes key and propagates the removal to streaming clients.
destroy
destroy(): booleanDestroys this colshape instance.
getStreamSyncedMeta
getStreamSyncedMeta<T = unknown>(key: string): T | undefinedReturns undefined if the key is unset.
getStreamSyncedMetaKeys
getStreamSyncedMetaKeys(): Array<string>Returns all stream-synced metadata keys stored on the entity.
hasStreamSyncedMeta
hasStreamSyncedMeta(key: string): booleanReturns whether the entity has a value for key.
isPointInside
isPointInside(x: number, y: number, z: number): booleanLocal geometric check using the cached shape parameters. Useful for ad-hoc queries; the server runs the same check on every UDP position packet.
setStreamSyncedMeta
setStreamSyncedMeta(key: string, value: unknown): voidSet or replace one key. The value is forwarded to every player currently streaming this entity, plus included in the snapshot for any future stream-in. Use deleteStreamSyncedMeta rather than undefined when the key must be removed.