---
name: "nearestMines"
type: command
status: ok
groups: ["Object Detection"]
arma3_since: "2.10"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/nearestMines
revid: 377408
updated: 2026-01-02T06:45:08Z
---

# nearestMines

*Command · Object Detection · Arma 3 v2.10*

## Description

Returns a list of nearest mines of the given types to the given position or object, within the specified distance.
If more than one mine are found they will be ordered by proximity by default, the closest one will be first in the array. The sorting can be turned off.

## Syntax

```sqf
nearestMines [position, types, radius, sort, 2Dmode]
```

**Parameters:**

- `position`:  [Object](../topics/Object.md) or [PositionAGL](../topics/Position.md#positionagl) or [Position2D](../topics/Position.md#introduction) - search position centre
- `types`: [Array](../topics/Array.md) - list of class name of the objects to search for (uses [isKindOf](../commands/isKindOf.md) comparison instead of direct class name == comparison). Use an empty array `[]` to search for all classes
- `radius`: [Number](../topics/Number.md) - search range
- `sort`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) [true](../commands/true.md) to sort the results closest first, [false](../commands/false.md) to turn off sorting
- `2Dmode`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) for 2D distance, [false](../commands/false.md) for 3D distance comparison

**Returns:** [Array](../topics/Array.md) - found mines as array of [Object](../topics/Object.md)s

## Examples

### Example 1

```sqf
nearestMines [player, ["MineBase"], 20];
```

### Example 2

```sqf
nearestMines [position player, ["DirectionalBombBase"], 500, true];
```

### Example 3

```sqf
nearestMines [[2716,2949,0], ["APERSTripMine_Wire_Ammo", "APERSMine_Range_Ammo"], 100, false, true];
```

### Example 4

Return every mine in 50 metres radius around player sorted by distance:

```sqf
nearestMines [player, [], 50];
```

## See also

[nearestTerrainObjects](../commands/nearestTerrainObjects.md) · [findNearestEnemy](../commands/findNearestEnemy.md) · [nearestBuilding](../commands/nearestBuilding.md) · [nearestObject](../commands/nearestObject.md) · [nearObjects](../commands/nearObjects.md) · [nearestLocation](../commands/nearestLocation.md) · [nearEntities](../commands/nearEntities.md) · [nearTargets](../commands/nearTargets.md) · [nearSupplies](../commands/nearSupplies.md) · [nearestLocationWithDubbing](../commands/nearestLocationWithDubbing.md) · [nearObjectsReady](../commands/nearObjectsReady.md) · [nearRoads](../commands/nearRoads.md) · [nearestObjects](../commands/nearestObjects.md)

<sub>Source: [BI Community Wiki — nearestMines](https://community.bistudio.com/wiki/nearestMines) (revision 377408).</sub>
