> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaksam-scripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Item harvested

> Déclenché côté serveur après qu'un item soit récolté dans un champ.

Déclenché après qu'un item ait été récolté dans un champ.

```lua Event theme={null}
RegisterNetEvent("drugs_creator:fields:itemHarvested", function(playerId, fieldId, itemName, itemQuantity)

end)
```

### Paramètres

| Nom | Type de donnée | Description |
| - | - | - |
| `playerId` | integer | ID serveur du joueur |
| `fieldId` | integer | ID du champ où l'item a été récolté |
| `itemName` | string | ID de l'item qui vient d'être récolté |
| `itemQuantity` | integer | Quantité d'item récoltée |

## Exemple

```lua theme={null}
-- Un exemple pour un système d'xp
RegisterNetEvent("drugs_creator:fields:itemHarvested", function(playerId, fieldId, itemName, itemQuantity)
    TriggerEvent("xp_system:addXp", playerId, itemName, itemQuantity)
end)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.