Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectServer APIGenerated

Gathering

const Gathering: object

Defined in: server/api.d.ts:5684

Finds and removes authored herbs and controls regrowth. Defaults are five times faster than the game’s authored species timings. Changes are held in server memory.

readonly respawnTime: GatheringRespawnTime | null

Current frozen override, or null for the species defaults at one fifth of their authored duration.

getHerbs(position, radius, virtualWorld?): GatheringHerb[]

Lists available authored herbs in a sphere, without requiring nearby players. Excludes picked or removed herbs and custom map assets. Invalid arguments throw.

Vector3

Centre in world metres; finite coordinates within +/-100000.

number

Inclusive 3D radius in metres, from 0 to 100000.

number

One virtual-world bucket, default 0. Pass player.virtualWorld for a player’s bucket. 0xffffffff selects only the global bucket. Invalid IDs throw.

GatheringHerb[]

removeHerbs(position, radius, virtualWorld?): number

Removes authored herbs in a sphere, including already-picked plants. Gives no rewards or harvest events. Removal lasts until an explicit respawn or server restart, regardless of regrowth timing changes.

Vector3

Centre in world metres; finite coordinates within +/-100000.

number

Inclusive 3D radius in metres, from 0 to 100000.

number

One virtual-world bucket, default 0. Pass player.virtualWorld for a player’s bucket. 0xffffffff selects only the global bucket. Invalid IDs throw.

number

Number newly marked for removal; repeated removal returns 0. Invalid arguments throw before mutation.

resetRespawnTime(): void

Restores five-times-faster species defaults and restarts active picked-herb timers from now. Script-removed herbs stay removed.

void

respawn(position, radius, virtualWorld?): number

Respawns picked and script-removed plants in a sphere, including plants with timed regrowth disabled. Restores client vegetation as well as server availability. Does not create new plants.

Vector3

Centre of the sphere in world metres; finite coordinates within +/-100000.

number

Inclusive 3D radius in metres, from 0 to 100000.

number

Only this virtual world; defaults to 0.

number

Number of active picked or script-removed sources restored. Invalid arguments throw.

respawnAll(virtualWorld?): number

Respawns every picked or script-removed plant in one virtual world, including plants with timed regrowth disabled.

number

Only this virtual world; defaults to 0.

number

Number of active picked or script-removed sources restored. Invalid arguments throw.

setRespawnTime(minHours, maxHours): boolean

Restarts active picked-herb deadlines from now and sets the policy for future picks. Script-removed herbs stay removed. Samples uniformly per plant. Equal bounds fix the duration; (0, 0) disables timed regrowth while manual respawn remains available. Applies to every virtual world.

number

Minimum game hours, from 0 to maxHours.

number

Maximum game hours, up to 87600. Positive durations must reach at least one game millisecond.

boolean

True on success; false for non-finite, reversed or out-of-range bounds.