REC_Farm
Exports
Current server exports and ox_inventory item-use hooks.
- Added
- Updated
The current public API consists of server-side planting/tilling requests and ox_inventory item-use hooks.
Server side
requestPlant
Start planting for a player. src is the server ID and seedItem is the seed item name.
exports.REC_Farm:requestPlant(src, seedItem)
Returns: boolean.
requestTill
Start tilling for the given server ID.
exports.REC_Farm:requestTill(src)
Returns: boolean.
useSeed
Seed item-use hook.
exports.REC_Farm:useSeed(event, item, inventory, slot)
Returns: false / nil.
useHoe
Hoe item-use hook.
exports.REC_Farm:useHoe(event, item, inventory, slot)
Returns: false / nil.
useRepairKit
Repair-kit item-use hook.
exports.REC_Farm:useRepairKit(event, item, inventory, slot)
Returns: false / nil.
useSeed, useHoe and useRepairKit handle usingItem and return false to prevent normal inventory consumption; other events return nil. Farm actions handle consumption. Set the item’s server.export to the appropriate hook, such as REC_Farm.useSeed.
Legacy exports such as getPlot, getAnimal and usePlantSeed, and the former client exports, are no longer registered.
