Hands-On Usage
has_mined is commonly used in naval warfare-related mods to detect whether a country has laid a sufficient number of mines along a target nation's coastline, thereby triggering specific events or unlocking decisions—such as blockade victory conditions, submarine warfare bonuses, and so forth. The following example checks whether Germany has laid more than 500 mines along the British coast to activate a blockade-related event:
# Within the trigger block of a country_event
GER = {
has_mined = {
target = ENG
value > 500
}
}
Synergy
[add_mines](/wiki/effect/add_mines): The most direct pairing—first use add_mines to lay mines along the target nation's coast, then use has_mined to detect whether the accumulated quantity has reached the threshold, forming a complete chain of "mine-laying → detection → reward".
[convoy_threat](/wiki/trigger/convoy_threat): The two often appear together in naval blockade logic, with mine quantity and convoy threat level jointly measuring the degree of pressure on the enemy's sea lines of communication.
[controls_state](/wiki/trigger/controls_state): In blockade mods, frequently used alongside has_mined to confirm that your side simultaneously controls adjacent coastal states, ensuring the blockade is established in both land and sea dimensions.
[any_owned_state](/wiki/trigger/any_owned_state): Can be used in conjunction when iterating through your own coastal states with any_owned_state, filtering which coastlines have actually completed mine-laying.
Common Pitfalls
- Reversed scope: The outer scope of
has_mined must be the mining nation (the side executing the mine-laying), and target is the nation being mined; newcomers often swap the two, writing the check under the target nation's scope, causing the condition to never evaluate as true.
- Missing value comparison operator: The
value field requires a comparison operator (such as value > 1000); writing value = 1000 directly is a syntax error that will cause the game log to silently fail or ignore the trigger.