A world object — the game's third entity type, covering everything that isn't a ped or a vehicle: crates, cones, ATMs, dropped items, placeable scenery.

Named Prop rather than Object to stay clear of Object in Haxe's own namespace and of the fivem.client.natives.Object extern.

var cone = Prop.create("prop_roadcone02a", position, false);
cone.placeOnGround();

Local props (the default) exist on this client only and are much cheaper — the right choice for decoration. Spawn networked props only when other players genuinely need to see and interact with them.

Static methods

@:value({ placeOnGround : false, networked : false })staticcreate(model:Hash, position:Vector3, networked:Bool = false, placeOnGround:Bool = false):Prop

Spawns a prop, streaming its model in first. Returns null if the model is invalid or failed to load.

Parameters:

networked

Whether other players can see it.

placeOnGround

Whether to snap it onto the surface below.

@:value({ networked : false })staticcreateNoOffset(model:Hash, position:Vector3, networked:Bool = false):Prop

Spawns a prop with its origin exactly at position, skipping the game's automatic model-offset correction.

Use this when placing props from saved coordinates — the offset applied by create is what makes a re-loaded object drift from where it was saved.

Constructor

new(handle:Int)

Methods

inlineplaceOnGround():Bool

Drops the prop so it rests correctly on whatever is beneath it, instead of floating or intersecting the ground.

Inherited Variables

Defined by Entity

alpha:Int

Opacity from 0 (invisible) to 255.

read onlyattachedTo:Entity

The entity this one is attached to, or null.

write onlycollision:Bool

read onlyexists:Bool

read onlyforwardVector:Vector3

The unit vector the entity faces.

write onlyfrozen:Bool

Whether the entity is pinned in place. Write-only — the game exposes no getter.

finalhandle:Int

The raw game handle.

read onlyhasControl:Bool

Whether this client currently owns the entity. Only the owner may modify a networked entity and have the change replicate.

heading:Float

Yaw only, in degrees — 0 faces north.

health:Int

read onlyheightAboveGround:Float

write onlyinvincible:Bool

read onlyisAttached:Bool

read onlyisDead:Bool

read onlyisNetworked:Bool

read onlymaxHealth:Int

read onlymodel:Int

The model hash this entity was created from.

read onlynetId:Int

The network ID, stable across all clients — the value to send in events. Returns 0 for a purely local entity.

write onlyoutline:Bool

Draws the game's selection outline around the entity.

rotation:Vector3

Rotation in degrees as (pitch, roll, yaw).

read onlyspeed:Float

Current speed in metres per second. Multiply by 3.6 for km/h, 2.237 for mph.

read onlystate:StateBag

The entity's replicated state bag. Reads work on any client; writes only replicate from the server.

read onlytype:EntityType

visible:Bool

Inherited Methods

Defined by Entity

@:value({ collision : false, bone : 0 })attachTo(target:Entity, offset:Vector3, rotation:Vector3, bone:Int = 0, collision:Bool = false):Void

Attaches this entity to target, offset from one of its bones.

Parameters:

bone

Bone index on the target; 0 attaches to its origin.

collision

Whether the two keep colliding with each other.

delete():Void

Deletes the entity.

Requires ownership: on a networked entity this silently does nothing unless requestControl() succeeded first.

@:value({ collision : true, keepVelocity : true })inlinedetach(keepVelocity:Bool = true, collision:Bool = true):Void

inlinedistanceTo(point:Vector3):Float

inlinedistanceToEntity(other:Entity):Float

@:value({ flags : 17 })inlinehasClearLineOfSightTo(other:Entity, flags:Int = 17):Bool

Whether nothing solid sits between this entity and other.

inlinemarkAsNoLongerNeeded():Void

Releases the entity back to the game, which may then despawn it.

inlineoffsetInWorldCoords(offset:Vector3):Vector3

Converts a position expressed in the entity's own frame into world space.

@:value({ timeoutMs : 1000 })requestControl(timeoutMs:Int = 1000):Bool

Asks the server for ownership and waits for it, returning whether it was granted before timeoutMs elapsed.

Every write to a networked entity you don't own is silently reverted by its real owner, so call this first:

if (vehicle.requestControl()) vehicle.repair();

Must be called from inside a coroutine. Ownership can be lost again at any moment, so keep the work that follows short.

@:value({ grabFromOtherScript : true })inlinesetAsMission(grabFromOtherScript:Bool = true):Void

Claims the entity for this script, so the game's population manager won't clean it up while you're using it.

teleport(position:Vector3, ?heading:Float):Void

Moves the entity without the game's usual "find a valid spot" fixups — no ground snapping, no pushing out of collision. Use it when you have already worked out exactly where the entity belongs.

toString():String

inlineworldToLocal(worldPosition:Vector3):Vector3

The inverse of offsetInWorldCoords: world space into the entity's frame.