---
title: "subscribe(to:_:)"
framework: realitykit
role: symbol
role_heading: Type Method
path: "realitykit/behaviortreeaction/subscribe(to:_:)-3p0pj"
---

# subscribe(to:_:)

Shadows the EntityAction.subscribe(to:_:) overload that takes a -> Void closure.

## Declaration

```swift
@MainActor @preconcurrency static func subscribe(to eventType: ActionEventType, _ handler: @escaping @MainActor (ActionEvent<Self>) -> Void)
```

## Discussion

Discussion When the handler doesn’t return a value, the action status is preserved: the value already in actionStatusPointer at the time the handler is called is read and written back, leaving the behavior tree’s status unchanged.

## See Also

### Subscribing to events

- [subscribe(to:_:)](realitykit/behaviortreeaction/subscribe(to:_:)-9mrvx.md)
