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

***

[SixL server API](../../README.md) / [entity](../README.md) / BasicMpPool

# Interface: BasicMpPool\<T\>

The members of the smaller pools (blips, markers, labels, checkpoints, colshapes, dummies): lookup and iteration only.
SixL-only name; these pools have no spatial queries.

## Extended by

- [`BlipMpPool`](../../world-entities/interfaces/BlipMpPool.md)
- [`MarkerMpPool`](../../world-entities/interfaces/MarkerMpPool.md)
- [`TextLabelMpPool`](../../world-entities/interfaces/TextLabelMpPool.md)
- [`CheckpointMpPool`](../../world-entities/interfaces/CheckpointMpPool.md)
- [`ColshapeMpPool`](../../world-entities/interfaces/ColshapeMpPool.md)
- [`DummyMpPool`](../../world-entities/interfaces/DummyMpPool.md)

## Type Parameters

### T

`T`

## Properties

### length

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

The number of entities in the pool.

#### Example

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

## Methods

### at()

> **at**(`id`): `T`

Finds an entity by id.

#### Parameters

##### id

`number`

The entity's id.

#### Returns

`T`

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

#### Example

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

***

### exists()

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

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

#### Parameters

##### entity

`number` \| `T`

An entity or its id.

#### Returns

`boolean`

True when it exists.

#### Example

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

***

### 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());
```

***

### 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());
```

***

### toArray()

> **toArray**(): `T`[]

A snapshot of all entities.

#### Returns

`T`[]

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

#### Example

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