[FREE] piercer_entdebug — Diagnose "Tried to access invalid entity" Errors

[FREE] piercer_entdebug — Diagnose “Tried to access invalid entity” Errors

A lightweight debugging tool for identifying invalid entity references on your FiveM server.

Overview

Have you ever encountered these errors in your server console?

[c-scripting-core] script error in native 00000000dafcb3ec:
Tried to access invalid entity: 132353

[c-scripting-core] script error in native 00000000972cc383:
Tried to access invalid entity: 132353

These errors indicate that a script is trying to access an entity that does not exist on the server.

The problem? FiveM usually doesn’t tell you which resource is responsible, what entity was involved, or why the entity became invalid.

This becomes even more difficult when dealing with escrowed or obfuscated resources.

piercer_entdebug was developed to help investigate these situations.

It tracks entities created and removed on the server. When an invalid entity error appears, you can copy the entity IDs from the console and use the provided commands to investigate their history.

Features

  • Entity tracking: Records entities created and removed by the server.

  • Entity identification: Displays entity type, model, network ID, population type and coordinates.

  • Creator and owner information: Helps identify which player created or owns an entity.

  • Removed entity detection: Identifies entities that existed but were subsequently removed.

  • Unknown entity detection: Identifies entity handles that the server never tracked.

  • Multiple ID support: Investigate multiple entity IDs in a single command.

  • Entity history: Keeps removed entity records in memory for a configurable period.

  • Native hash reference: Includes common native hashes to help identify which native generated the error.

  • Lightweight: Reacts to entity creation and removal events instead of constantly scanning entities.

  • Read-only: Does not modify, create or delete entities.

Commands

Command Description
entinfo <id> [id ...] Displays information about one or multiple entities.
entlast [n] Lists the last removed entities. Default: 20.
entstats Displays tracking duration and memory statistics.
entclear Clears recorded data and resets tracking.

All commands are available through the server console, including txAdmin Live Console.

In-game usage is also supported through the permission system.

Installation

Requirements:

  • FiveM Server

  • OneSync

  • framezero_bridge (mandatory dependency)

1. Download the resources

Download both repositories and place them inside your server’s resources folder.

resources/
├── framezero_bridge/
└── piercer_entdebug/

Important: framezero_bridge is required for permission handling and in-game notifications.

2. Start the resource

Execute the following commands in your server console:

refresh
ensure piercer_entdebug

There is no need to keep it permanently in your server.cfg. It is designed as a debugging tool that can be started whenever needed.

3. Wait for the error

Make sure the resource is running before the invalid entity error occurs.

Entities removed before tracking starts cannot be retrieved.

Usage Example

When the following error appears:

Tried to access invalid entity: 154872

Run:

entinfo 154872

You can also investigate multiple entities at once:

entinfo 154872 160233 139981

Understanding the results

REMOVED

The entity existed on the server but was subsequently deleted.

The output includes information such as:

  • Entity handle

  • Network ID

  • Entity type

  • Model

  • Population type

  • Creator

  • Owner

  • Coordinates

  • Heading

This can help identify which system was responsible for creating or managing the entity.

STILL EXISTS

The entity is currently valid on the server. The error may have occurred during entity creation or migration.

THE SERVER NEVER SAW THIS ENTITY

This is particularly useful when investigating client entity handles incorrectly sent to the server.

For example, a client may send a local vehicle handle through a server event. The server then attempts to use that number as if it were a valid server entity.

The resource helps identify this situation.

Configuration

The resource provides optional server convars.

Convar Default Description
entdebug_keep_minutes 30 How long removed entities remain in memory.
entdebug_track_created true Enables tracking of entity creation.

Example:

set entdebug_keep_minutes 60
set entdebug_track_created true

Permissions

Permissions can be configured through config.lua using framezero_bridge.

Default configuration:

Config.perms = { 'admin' }

ACE permissions are also supported:

add_ace group.admin command.entinfo allow
add_ace group.admin command.entlast allow
add_ace group.admin entdebug.admin allow

The server console always has permission to execute commands.

Performance

The resource is designed to have minimal overhead.

  • No continuous entity scanning.

  • No constant polling loops.

  • Event-driven entity tracking.

  • Automatic cleanup of expired records.

  • No entity modifications.

It is intended to be started when investigating server-side entity errors and stopped when debugging is complete.

Compatibility

Works with different frameworks through the mandatory framezero_bridge dependency:

  • ESX

  • QBCore

  • Qbox

  • vRP

  • vRPex

  • Creative

  • Standalone

Download

piercer_entdebug — GitHub Repository

Dependency — framezero_bridge

Support & Community

For bug reports, questions or suggestions:

Discord: framezero development

Developer: PIERCER
Organization: FrameZero Development

Pull requests and community feedback are welcome.


Resource Information

Code is accessible Yes
Subscription-based No
Lines (approximately) See repository
Requirements FiveM Server, OneSync, framezero_bridge
Support Yes

Developed by PIERCER — FrameZero Development.