# CFX::GET_ENTITY_ATTACHED_TO

- **Hash:** `0xFE1589F9`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetEntityAttachedTo`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_ENTITY_ATTACHED_TO

## Signature

```c
Entity GET_ENTITY_ATTACHED_TO(Entity entity);
```

## Parameters

- `entity` (`Entity`) — The entity to check.

## Returns

`Entity` — The attached entity handle. 0 returned if the entity is not attached.

## Description

*Source: Cfx.re native reference*

Gets the entity that this entity is attached to.

## Usage

### Lua

```lua
local retval = GetEntityAttachedTo(entity)

-- always available, by hash
local retval = Citizen.InvokeNative(0xfe1589f9, entity, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetEntityAttachedTo(entity);

// by hash
const retval = Citizen.invokeNative('0xfe1589f9', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xfe1589f9, entity);
```

*Sources: Cfx.re native reference.*
