{"name":"nearestMines","operator":null,"title":"nearestMines","type":"command","url":"https://community.bistudio.com/wiki/nearestMines","revid":377408,"updated":"2026-01-02T06:45:08Z","groups":["Object Detection"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.10"}],"since":{"game":"arma3","name":"Arma 3","version":"2.10"},"arma3_since":"2.10","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns a list of nearest mines of the given types to the given position or object, within the specified distance.\nIf 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.","syntaxes":[{"syntax":"nearestMines [position, types, radius, sort, 2Dmode]","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":"Object or PositionAGL or Position2D","optional":false,"default":null,"description":"search position centre","types":["Object","PositionAGL","Position2D"],"since":null,"text":"position:  Object or PositionAGL or Position2D - search position centre"},{"name":"types","type":"Array","optional":false,"default":null,"description":"list of class name of the objects to search for (uses isKindOf comparison instead of direct class name == comparison). Use an empty array `[]` to search for all classes","types":["Array"],"since":null,"text":"types: Array - list of class name of the objects to search for (uses isKindOf comparison instead of direct class name == comparison). Use an empty array `[]` to search for all classes"},{"name":"radius","type":"Number","optional":false,"default":null,"description":"search range","types":["Number"],"since":null,"text":"radius: Number - search range"},{"name":"sort","type":"Boolean","optional":true,"default":"true","description":"true to sort the results closest first, false to turn off sorting","types":["Boolean"],"since":null,"text":"sort: Boolean - (Optional, default true) true to sort the results closest first, false to turn off sorting"},{"name":"2Dmode","type":"Boolean","optional":true,"default":"false","description":"true for 2D distance, false for 3D distance comparison","types":["Boolean"],"since":null,"text":"2Dmode: Boolean - (Optional, default false) true for 2D distance, false for 3D distance comparison"}],"returns":{"type":"Array","types":["Array"],"description":"found mines as array of Objects","text":"Array - found mines as array of Objects"},"form":"unary","operator":null,"left":null,"right":{"text":"[position, types, radius, sort, 2Dmode]","types":["Array"]}}],"examples":[{"text":"```sqf\nnearestMines [player, [\"MineBase\"], 20];\n```","code":["nearestMines [player, [\"MineBase\"], 20];"]},{"text":"```sqf\nnearestMines [position player, [\"DirectionalBombBase\"], 500, true];\n```","code":["nearestMines [position player, [\"DirectionalBombBase\"], 500, true];"]},{"text":"```sqf\nnearestMines [[2716,2949,0], [\"APERSTripMine_Wire_Ammo\", \"APERSMine_Range_Ammo\"], 100, false, true];\n```","code":["nearestMines [[2716,2949,0], [\"APERSTripMine_Wire_Ammo\", \"APERSMine_Range_Ammo\"], 100, false, true];"]},{"text":"Return every mine in 50 metres radius around player sorted by distance:\n\n```sqf\nnearestMines [player, [], 50];\n```","code":["nearestMines [player, [], 50];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["nearestTerrainObjects","findNearestEnemy","nearestBuilding","nearestObject","nearObjects","nearestLocation","nearEntities","nearTargets","nearSupplies","nearestLocationWithDubbing","nearObjectsReady","nearRoads","nearestObjects"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Detection","Introduced with Arma 3 version 2.10","Scripting Commands"]}