---
name: "Arma 3: Eden Editor Event Handlers"
type: topic
aliases: ["Arma 3: Event Handlers: Eden Editor"]
source: https://community.bistudio.com/wiki/Arma_3:_Eden_Editor_Event_Handlers
revid: 376091
updated: 2025-08-15T03:30:27Z
---

# Arma 3: Eden Editor Event Handlers

### Editor Event Handlers

Eden Editor Event Handlers are added to the editor instance and will remain active for the duration of a session.
Launching a preview will keep the event handlers, but closing the editor will erase all of them and you will have to add them again on the next Eden instance.

#### Related commands

- [add3DENEventHandler](../commands/add3DENEventHandler.md)
- [remove3DENEventHandler](../commands/remove3DENEventHandler.md)

#### Event Scripts

- See [init3DEN.sqf](../topics/Event_Scripts.md#init3den-sqf)

#### Config

Alternatively, you can define event handlers directly in the config.
Use your custom section (**mySection** in the example) to prevent overriding handlers from other sources.
Handlers defined here will automatically be added when Eden Editor is opened.

```cpp
class Cfg3DEN
{
    class EventHandlers
    {
        class mySection
        {
            onUndo = "hint 'Undo';";
            // <handlerName> = <handlerExpression>
        };
    };
};
```

#### Events

The following [Magic Variables](../topics/Magic_Variables.md) are available inside the event's code:

- Event Handler parameters are accessible via `_this` (only if event has parameters)
- The Event Handler type is available as `_thisEvent`
- The Event Handler index is available as `_thisEventHandler`

> [!NOTE]
> - Most handlers do not receive any arguments; this is intended, as in most cases required data can be obtained using either [get3DENActionState](../commands/get3DENActionState.md) or specialised 'get*' Eden Editor commands.
> - Note that unlike [object's](../topics/Event_Handlers.md) or [mission's](../topics/Mission_Event_Handlers.md) event handlers, the **On** prefix is present in both config and command event name.

##### Init

Is executed when Eden Editor display was created. Only happens when Eden Editor is opened for the first time during game session, only available through config modding.

```cpp
init = " params ['_display3DEN']; systemChat 'First Eden launch this session'; ";
```

- display3DEN: [Display](../topics/Display.md)

##### OnBeforeMissionPreview (Arma 3 v2.18)

Runs before the scenario preview is started. If an event handler of this type returns [true](../commands/true.md), the mission preview will not be initialised.

```sqf
add3DENEventHandler ["OnBeforeMissionPreview", {
    params ["_isPreviewMultiplayer"];
}];
```

##### OnConnectingStart

When [Connecting](../topics/Eden_Editor~3A_Connecting.md) operation is initiated.

```sqf
add3DENEventHandler ["OnConnectingStart", {
    params ["_class", "_from"];
}];
```

- class: [Config](../topics/Config.md) - connection config class
- from: [Array of Eden Entities](../topics/Array_of_Eden_Entities.md)

##### OnConnectingEnd

When [Connecting](../topics/Eden_Editor~3A_Connecting.md) operation is terminated, no matter if it was confirmed or canceled.

```sqf
add3DENEventHandler ["OnConnectingEnd", {
    params ["_class", "_from", "_to"];
}];
```

- class: Config - connection config class
- from: Array of 3DEN entities
- to: [Eden Entity](../topics/Eden_Entity.md) (when connecting was successful) or [nil](../commands/nil.md) (when connecting was terminated)

##### OnCopy

Fires when entities are copied.\
Also fires when entities are cut, but unlike [OnCut](../topics/Eden_Editor_Event_Handlers.md#oncut), [OnCopy](../topics/Eden_Editor_Event_Handlers.md#oncopy) fires before the entities are deleted, meaning the entities are still accessible with [get3DENSelected](../commands/get3DENSelected.md).

```sqf
add3DENEventHandler ["OnCopy", {
    // no arguments
}];
```

##### OnCut

Fires when entities are cut (after the entities have been deleted).

```sqf
add3DENEventHandler ["OnCut", {
    // no arguments
}];
```

##### OnDeleteUnits

When entities are deleted.

```sqf
add3DENEventHandler ["OnDeleteUnits", {
    // no arguments
}];
```

##### OnEditableEntityAdded (Arma 3 v2.18)

When an entity gets added to the scenario. When compositions are added, the event triggers for every entity in the composition.

```sqf
add3DENEventHandler ["OnEditableEntityAdded", {
    params ["_entity"];
}];
```

entity - [Eden Entity](../topics/Eden_Entity.md)

##### OnEditableEntityRemoved (Arma 3 v2.18)

When an entity gets removed from the scenario.

```sqf
add3DENEventHandler ["OnEditableEntityRemoved", {
    params ["_entity"];
}];
```

entity - [Eden Entity](../topics/Eden_Entity.md)

##### OnEntityAttributeChanged (Arma 3 v2.18)

When an entity's attribute got changed. Fires for each changed attribute separately.

```sqf
add3DENEventHandler ["OnEntityAttributeChanged", {
    params ["_entity", "_property"];
}];
```

- entity: [Eden Entity](../topics/Eden_Entity.md)
- property: [String](../topics/String.md) - property name of the attribute that was changed

##### OnEntityDragged (Arma 3 v2.18)

When an entity gets dragged. Fires continiously until the left mouse button is released.

```sqf
add3DENEventHandler ["OnEntityDragged", {
    params ["_entity"];
}];
```

entity - [Eden Entity](../topics/Eden_Entity.md)

##### OnEntityMenu

When [Entity Context Menu](../topics/Eden_Editor~3A_Entity_Context_Menu.md) is opened.

```sqf
add3DENEventHandler ["OnEntityMenu", {
    params ["_position", "_entity", "_listPath"];
}];
```

- position: [Array](../topics/Array.md) - [Position](../topics/Position.md) where user clicked to open the menu.
  - Entity position when clicked on an entity.
  - Empty array when clicked on something that doesn't have position (i.e. abstract folder in Edit list like BLUFOR, Trigger, etc.)
- entity: [Eden Entity](../topics/Eden_Entity.md)
  - Nil when clicked on empty space
- listPath: [Array](../topics/Array.md) - UI tree path when clicked on entity in the entity list.
  - Nil when clicked in the scene (we cannot use empty array, because that's a path to root item)

##### OnEntityParentChanged (Arma 3 v2.18)

Fires when the parent of an entity changes. For example, creating waypoints, moving entities into layers or out of layers.
It seems that this EH always fires twice. First event returns [objNull](../commands/objNull.md) for _newParentEntityID.

```sqf
add3DENEventHandler ["OnEntityParentChanged", {
    params ["_affectedEntity", "_newParentEntityID"]
}];
```

- affectedEntity: [Array](../topics/Array.md), [Object](../topics/Object.md), [String](../topics/String.md), [Number](../topics/Number.md)
  - [Array](../topics/Array.md) - waypoint
  - [Object](../topics/Object.md) - trigger, unit, vehicle, logic
  - [String](../topics/String.md) - marker
  - [Number](../topics/Number.md) - layer
- newParentEntityID: [Number](../topics/Number.md) or [objNull](../commands/objNull.md)
  - [Number](../topics/Number.md)- the new parent entity
  - [objNull](../commands/objNull.md) - If new parent entity is a system layer.

##### OnGridChange

When grid changes, either using [Toolbar](../topics/Eden_Editor~3A_Toolbar.md) option, ot by scripting command [set3DENGrid](../commands/set3DENGrid.md).

```sqf
add3DENEventHandler ["OnGridChange", {
    params ["_gridType", "_gridValue"];
}];
```

- gridType: [String](../topics/String.md) - can be "translation", "rotation" or "scaling"
- gridValue: [Number](../topics/Number.md)

##### OnHistoryChange

When history changes.

```sqf
add3DENEventHandler ["OnHistoryChange", {
    // no arguments
}];
```

##### OnMapClosed

When map is closed.

```sqf
add3DENEventHandler ["OnMapClosed", {
    // no arguments
}];
```

##### OnMapOpened

When map is opened.

```sqf
add3DENEventHandler ["OnMapOpened", {
    // no arguments
}];
```

##### OnMessage

Handler used for showing on-screen notifications, triggered by various range of events.
Message IDs:

- 0 - Mission saved
- 1 - Mission autosaved
- 2 - Trying to move a character into full vehicle
- 3 - Moved character into enemy vehicle
- 4 - Trying to run mission without any player
- 5 - Mission exported to SP
- 6 - Mission exported to MP
- 7 - Attempting to delete a default layer

```sqf
add3DENEventHandler ["OnMessage", {
    params ["_messageID"];
}];
```

- messageID: [Number](../topics/Number.md)

##### OnMissionAttributeChanged (Arma 3 v2.18)

When a mission attribute or the preferences are changed.

```sqf
add3DENEventHandler ["OnMissionAttributeChanged", {
    params ["_section", "_property"];
}];
```

- section - [String](../topics/String.md) - section name, see [sections](../topics/Eden_Editor~3A_Setting_Attributes.md#sections-properties)
- property - [String](../topics/String.md) - property name of the attribute, see [properties](../topics/Eden_Editor~3A_Setting_Attributes.md#sections-properties)

##### OnMissionAutosave

When scenario is autosaved.

```sqf
add3DENEventHandler ["OnMissionAutosave", {
    // no arguments
}];
```

##### OnMissionExportSP

When a scenario is exported to singleplayer.

```sqf
add3DENEventHandler ["OnMissionExportSP", {
    // no arguments
}];
```

##### OnMissionExportMP

When a scenario is exported to multiplayer.

```sqf
add3DENEventHandler ["OnMissionExportMP", {
    // no arguments
}];
```

##### OnMissionListChange

When the current list of missions in the open/save mission dialog changes, i.e when first opened or a different folder is selected.

```sqf
add3DENEventHandler ["OnMissionListChange", {
    // no arguments
}];
```

##### OnMissionLoad

When scenario is loaded.

If a missing config is preventing the scenario from being loaded, this event handler will only be executed after pressing the "Force Load" button.

```sqf
add3DENEventHandler ["OnMissionLoad", {
    // no arguments
}];
```

##### OnMissionNew

When new scenario is started. Executed also when Eden is opened with an empty scenario.

```sqf
add3DENEventHandler ["OnMissionNew", {
    // no arguments
}];
```

##### OnMissionPreview

When scenario preview is started. Executed when the scenario is already loaded, so entities in it can be accessed.

```sqf
add3DENEventHandler ["OnMissionPreview", {
    params ["_objects", "_groups", "_waypoints", "_markers"];
}];
```

- objects: Array
- groups: Array
- waypoints: Array
- markers: Array

Each array is in format:

```
[entity1, id1, entity2, id2, ..., entityN, idN]
```

- entity: [Object](../topics/Object.md), [Group](../topics/Group.md), [Array](../topics/Array.md) or [String](../topics/String.md)
- ID: [Number](../topics/Number.md)

##### OnMissionPreviewEnd

When preview ends and user returns back to Eden Editor.

> [!IMPORTANT]
> In order to manipulate entities during this event the code needs to be run [scheduled](../commands/spawn.md) with some [delay](../commands/sleep.md)!

```sqf
add3DENEventHandler ["OnMissionPreviewEnd", {
    // no arguments
}];
```

##### OnMissionSave

When scenario is saved.

```sqf
add3DENEventHandler ["OnMissionSave", {
    // no arguments
}];
```

##### OnMissionSaveAs

When *Save As* action is triggered (i.e. Save window is opened, but the mission is not necessarily saved yet).

```sqf
add3DENEventHandler ["OnMissionSaveAs", {
    // no arguments
}];
```

##### OnModeChange

When editing mode is changed (i.e. from Objects to Triggers).

```sqf
add3DENEventHandler ["OnModeChange", {
    // no arguments
}];
```

##### OnMoveGridDecrease

```sqf
add3DENEventHandler ["OnMoveGridDecrease", {
    // params ["?"];
}];
```

##### OnMoveGridIncrease

```sqf
add3DENEventHandler ["OnMoveGridIncrease", {
    // params ["?"];
}];
```

##### OnMoveGridToggle

When **translation** grid is toggled on or off.

```sqf
add3DENEventHandler ["OnMoveGridToggle", {
    // no arguments
}];
```

##### OnPaste

When entities are pasted.

```sqf
add3DENEventHandler ["OnPaste", {
    // no arguments
}];
```

##### OnPasteUnitOrig

When entities are pasted on their original positions.

```sqf
add3DENEventHandler ["OnPasteUnitOrig", {
    // no arguments
}];
```

##### OnRedo

When undo operation is redone.

```sqf
add3DENEventHandler ["OnRedo", {
    // no arguments
}];
```

##### OnRotateGridDecrease

```sqf
add3DENEventHandler ["OnRotateGridDecrease", {
    // params ["?"];
}];
```

##### OnRotateGridIncrease

```sqf
add3DENEventHandler ["OnRotateGridIncrease", {
    // params ["?"];
}];
```

##### OnRotateGridToggle

When **rotation** grid is toggled on or off.

```sqf
add3DENEventHandler ["OnRotateGridToggle", {
    // no arguments
}];
```

##### OnScaleGridToggle

When **area scaling** grid is toggled on or off.

```sqf
add3DENEventHandler ["OnScaleGridToggle", {
    // no arguments
}];
```

##### OnSearchCreate

When "SearchCreate" action is triggered (e.g. when pressing Ctrl+Shift+F).

```sqf
add3DENEventHandler ["OnSearchCreate", {
    // no arguments
}];
```

##### OnSearchEdit

When "SearchEdit" action is triggered (e.g. when pressing Ctrl+F).

```sqf
add3DENEventHandler ["OnSearchEdit", {
    // no arguments
}];
```

##### OnSelectionChange

When entity selection changes. Use [get3DENSelected](../commands/get3DENSelected.md) to return currently selected entities.

```sqf
add3DENEventHandler ["OnSelectionChange", {
    // no arguments
}];
```

##### OnServerToggle

When server is created or destroyed from the preview.

```sqf
add3DENEventHandler ["OnServerToggle", {
    // no arguments
}];
```

##### OnSubmodeChange

When submode (e.g. BLUFOR or OFPOR for Objects, or Modules for Systems) changes.

```sqf
add3DENEventHandler ["OnSubmodeChange", {
    // no arguments
}];
```

##### OnSurfaceSnapToggle

When surface snap settings are changed.

```sqf
add3DENEventHandler ["OnSurfaceSnapToggle", {
    // no arguments
}];
```

##### OnTerrainNew

When new terrain is loaded. Executed also when Eden is opened.

```sqf
add3DENEventHandler ["OnTerrainNew", {
    // no arguments
}];
```

##### OnToggleMapIDs

When map IDs are toggled with `do3DENAction "ToggleMapIDs"`. Only triggers if map is open.

```sqf
add3DENEventHandler ["OnToggleMapIDs", {
    // no arguments
}];
```

##### OnToggleMapTextures

When map textures are toggled on or off.

```sqf
add3DENEventHandler ["OnToggleMapTextures", {
    // no arguments
}];
```

##### OnTogglePlaceEmptyVehicle

When the *Place vehicles with crew* is toggled on/off in Objects mode.

```sqf
add3DENEventHandler ["OnTogglePlaceEmptyVehicle", {
    // no arguments
}];
```

##### OnUndo

When an operation is undone.

```sqf
add3DENEventHandler ["OnUndo", {
    // no arguments
}];
```

##### OnVerticalToggle

When vertical mode settings are changed.

```sqf
add3DENEventHandler ["OnVerticalToggle", {
    // no arguments
}];
```

##### OnWidgetArea

When [area widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is selected.

```sqf
add3DENEventHandler ["OnWidgetArea", {
    // no arguments
}];
```

##### OnWidgetNone

When no [widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is selected.

```sqf
add3DENEventHandler ["OnWidgetNone", {
    // no arguments
}];
```

##### OnWidgetRotation

When [rotation widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is selected.

```sqf
add3DENEventHandler ["OnWidgetRotation", {
    // no arguments
}];
```

##### OnWidgetScale

When [scaling widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is selected.

```sqf
add3DENEventHandler ["OnWidgetScale", {
    // no arguments
}];
```

##### OnWidgetToggle

When [widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is toggled (i.e. browsing through all widget types)

```sqf
add3DENEventHandler ["OnWidgetToggle", {
    // no arguments
}];
```

##### OnWidgetTranslation

When [translation widget](../topics/Eden_Editor~3A_Transformation_Widget.md) is selected.

```sqf
add3DENEventHandler ["OnWidgetTranslation", {
    // no arguments
}];
```

##### OnWorkspacePartSwitch

When [scenario phase](../topics/Eden_Editor~3A_Scenario_Phases.md) is selected.

```sqf
add3DENEventHandler ["OnWorkspacePartSwitch", {
    // no arguments
}];
```

### Object Event Handlers

Editor specific event handlers can be also added directly to [objects](../topics/Eden_Editor~3A_Object.md), using [addEventHandler](../commands/addEventHandler.md) command.

> [!IMPORTANT]
> These handlers exist only for the duration of active workspace.
> Running a preview or loading the same scenario again will erase all object event handlers, because objects themselves are despawned from the world and then created again.

#### Related commands

- [addEventHandler](../commands/addEventHandler.md)
- [removeEventHandler](../commands/removeEventHandler.md)

#### Events

> [!NOTE]
> Most handlers do not receive any arguments.
> This is intended, because in most cases, required data can be obtained using either [get3DENActionState](../commands/get3DENActionState.md) or specialised 'get' commands.

> [!IMPORTANT]
> None of the following event handlers work for triggers.

##### AttributesChanged3DEN

Fires when object's attributes are changed. Can happen when:

- Changing the attributes by dragging, rotating or using one of the widgets
- Changing and saving the attributes from within the attributes window
- When attributes get changed using scripting commands such as [set3DENAttributes](../commands/set3DENAttributes.md) or [set3DENAttribute](../commands/set3DENAttribute.md)

Unlike *Dragged3DEN* this event handler will not fire continuously but only when the attributes were changed **and** saved

```sqf
edenObject addEventHandler ["AttributesChanged3DEN", {
    params ["_object"];
}];
```

- object: [Object](../topics/Object.md) - affected object

##### ConnectionChanged3DEN

When a [connection](../topics/Eden_Editor~3A_Connecting.md) is added or removed from an object.

```sqf
edenObject addEventHandler ["ConnectionChanged3DEN", {
    params ["_object"];
}];
```

- object: [Object](../topics/Object.md) - affected object

##### RegisteredToWorld3DEN

When object is re-added to the scenario after undoing a delete operation.

```sqf
edenObject addEventHandler ["RegisteredToWorld3DEN", {
    params ["_object"];
}];
```

- object: [Object](../topics/Object.md) - affected object

##### UnregisteredFromWorld3DEN

When object is removed from the scenario. That happens when you delete it, but also when you undo [placement](../topics/Eden_Editor~3A_Entity_Placing.md) operation.

```sqf
edenObject addEventHandler ["UnregisteredFromWorld3DEN", {
    params ["_object"];
}];
```

- object: [Object](../topics/Object.md) - affected object

##### Dragged3DEN

When object is **dragged** and/or **rotated**. Also triggers when widgets are used to manipulate position and orientation. Does not trigger when the object's size is changed.

```sqf
edenObject addEventHandler ["Dragged3DEN", {
    params ["_object"];
}];
```

- object: [Object](../topics/Object.md) - affected object

<sub>Source: [BI Community Wiki — Arma 3: Eden Editor Event Handlers](https://community.bistudio.com/wiki/Arma_3:_Eden_Editor_Event_Handlers) (revision 376091).</sub>
