SpawnTestItem
spawnTestItem
Spawns the catalog-backed synchronized test apple near a player.
Syntax
bool spawnTestItem(int playerId [, number heightOffset = 0])
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
heightOffset |
number |
no | Optional vertical offset in metres, clamped to the validated test range. |
Returns
Returns true when the authoritative spawn request is accepted; otherwise returns false.
Examples
Spawn a pickup at the invoking player's feet:
addCommandHandler("spawnitem", function(playerId)
if not spawnTestItem(playerId) then
outputChatBox("The item could not be spawned.", playerId)
end
end)
Notes
- Available only in server-side resource scripts.
- The server owns the item identity, revision, visibility, pickup validation, inventory award, and late-join state.
- This function deliberately spawns only the validated test apple. It is not a generic arbitrary asset loader.