[**SixL server API**](../../README.md)

***

[SixL server API](../../README.md) / [world-entities](../README.md) / ColshapeMpPool

# Interface: ColshapeMpPool

The pool of colshapes: `mp.colshapes`.

## Example

```ts
const zone = mp.colshapes.newCircle(0, 0, 20);
```

## Extends

- [`BasicMpPool`](../../entity/interfaces/BasicMpPool.md)\<[`ColshapeMp`](ColshapeMp.md)\>

## Properties

### length

> `readonly` **length**: `number`

The number of entities in the pool.

#### Example

```ts
const count = mp.blips.length;
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`length`](../../entity/interfaces/BasicMpPool.md#length)

## Methods

### at()

> **at**(`id`): [`ColshapeMp`](ColshapeMp.md)

Finds an entity by id.

#### Parameters

##### id

`number`

The entity's id.

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The entity, or `null` when there is none.

#### Example

```ts
const blip = mp.blips.at(1);
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`at`](../../entity/interfaces/BasicMpPool.md#at)

***

### exists()

> **exists**(`entity`): `boolean`

Whether an entity (or an id) is still in the pool.

#### Parameters

##### entity

`number` \| [`ColshapeMp`](ColshapeMp.md)

An entity or its id.

#### Returns

`boolean`

True when it exists.

#### Example

```ts
if (mp.blips.exists(blip)) { }
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`exists`](../../entity/interfaces/BasicMpPool.md#exists)

***

### forEach()

> **forEach**(`callingFunction`): `void`

Calls a function for every entity.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each entity.

#### Returns

`void`

#### Example

```ts
mp.blips.forEach((b) => b.destroy());
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEach`](../../entity/interfaces/BasicMpPool.md#foreach)

***

### forEachFast()

> **forEachFast**(`callingFunction`): `void`

Calls a function for every entity; the same as `forEach` in SixL.

#### Parameters

##### callingFunction

(`entity`) => `void`

Called with each entity.

#### Returns

`void`

#### Example

```ts
mp.blips.forEachFast((b) => b.destroy());
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`forEachFast`](../../entity/interfaces/BasicMpPool.md#foreachfast)

***

### newCircle()

> **newCircle**(`x`, `y`, `range`, `dimension?`): [`ColshapeMp`](ColshapeMp.md)

Creates a circle (a vertical cylinder of infinite height: z is ignored).

#### Parameters

##### x

`number`

Centre x, metres.

##### y

`number`

Centre y, metres.

##### range

`number`

Radius, metres.

##### dimension?

`number`

The dimension (default 0).

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The colshape.

#### Example

```ts
const zone = mp.colshapes.newCircle(0, 0, 20);
```

***

### newCuboid()

> **newCuboid**(`x`, `y`, `z`, `width`, `depth`, `height`, `dimension?`): [`ColshapeMp`](ColshapeMp.md)

Creates a cuboid centred on a point.

#### Parameters

##### x

`number`

Centre x, metres.

##### y

`number`

Centre y, metres.

##### z

`number`

Centre z, metres.

##### width

`number`

Size along x, metres.

##### depth

`number`

Size along y, metres.

##### height

`number`

Size along z, metres.

##### dimension?

`number`

The dimension (default 0).

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The colshape.

#### Example

```ts
const zone = mp.colshapes.newCuboid(0, 0, 70, 10, 10, 4);
```

***

### newRectangle()

> **newRectangle**(`x`, `y`, `width`, `height`, `dimension?`): [`ColshapeMp`](ColshapeMp.md)

Creates a rectangle centred on a point (z is ignored).

#### Parameters

##### x

`number`

Centre x, metres.

##### y

`number`

Centre y, metres.

##### width

`number`

Size along x, metres.

##### height

`number`

Size along y, metres.

##### dimension?

`number`

The dimension (default 0).

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The colshape.

#### Example

```ts
const zone = mp.colshapes.newRectangle(0, 0, 10, 20);
```

***

### newSphere()

> **newSphere**(`x`, `y`, `z`, `range`, `dimension?`): [`ColshapeMp`](ColshapeMp.md)

Creates a sphere.

#### Parameters

##### x

`number`

Centre x, metres.

##### y

`number`

Centre y, metres.

##### z

`number`

Centre z, metres.

##### range

`number`

Radius, metres.

##### dimension?

`number`

The dimension (default 0).

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The colshape.

#### Example

```ts
const zone = mp.colshapes.newSphere(0, 0, 70, 5);
```

***

### newTube()

> **newTube**(`x`, `y`, `z`, `range`, `height`, `dimension?`): [`ColshapeMp`](ColshapeMp.md)

Creates a tube: a vertical cylinder standing on its bottom centre.

#### Parameters

##### x

`number`

Bottom centre x, metres.

##### y

`number`

Bottom centre y, metres.

##### z

`number`

Bottom centre z, metres.

##### range

`number`

Radius, metres.

##### height

`number`

Height above `z`, metres.

##### dimension?

`number`

The dimension (default 0).

#### Returns

[`ColshapeMp`](ColshapeMp.md)

The colshape.

#### Remarks

The fourth argument is the radius and the fifth the height. RAGE MP's typings and manual order them
the other way (`height`, `range`): a script ported from RAGE MP must swap them.

#### Example

```ts
const zone = mp.colshapes.newTube(0, 0, 70, 3, 5);
```

***

### toArray()

> **toArray**(): [`ColshapeMp`](ColshapeMp.md)[]

A snapshot of all entities.

#### Returns

[`ColshapeMp`](ColshapeMp.md)[]

A new array; changing it does not change the pool.

#### Example

```ts
const all = mp.blips.toArray();
```

#### Inherited from

[`BasicMpPool`](../../entity/interfaces/BasicMpPool.md).[`toArray`](../../entity/interfaces/BasicMpPool.md#toarray)
