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

***

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

# Interface: MarkerMpPool

The pool of markers: `mp.markers`.

## Example

```ts
mp.markers.forEach((m) => m.destroy());
```

## Extends

- [`BasicMpPool`](../../entity/interfaces/BasicMpPool.md)\<[`MarkerMp`](MarkerMp.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`): [`MarkerMp`](MarkerMp.md)

Finds an entity by id.

#### Parameters

##### id

`number`

The entity's id.

#### Returns

[`MarkerMp`](MarkerMp.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` \| [`MarkerMp`](MarkerMp.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)

***

### new()

> **new**(`type`, `position`, `scale`, `options?`): [`MarkerMp`](MarkerMp.md)

Creates a marker.

#### Parameters

##### type

`number`

The marker kind.

##### position

[`Vector3`](../../common/interfaces/Vector3.md)

Where (metres).

##### scale

`number`

The size, in metres.

##### options?

Optional: `color` (an `[r, g, b, a]` array or `{ r, g, b, a }`; default white), `direction`,
`rotation`, `visible` (default true) and `dimension` (default 0).

###### color?

[`Array4d`](../../common/type-aliases/Array4d.md)

###### dimension?

`number`

###### direction?

[`IVector3`](../../common/interfaces/IVector3.md)

###### rotation?

[`IVector3`](../../common/interfaces/IVector3.md)

###### visible?

`boolean`

#### Returns

[`MarkerMp`](MarkerMp.md)

The marker.

#### Remarks

Partial: see [MarkerMp](MarkerMp.md).

#### Example

```ts
const m = mp.markers.new(1, new mp.Vector3(0, 0, 70), 2, { color: [0, 255, 0, 100] });
```

***

### toArray()

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

A snapshot of all entities.

#### Returns

[`MarkerMp`](MarkerMp.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)
