Gathering

Herb picking and regrowth. Players pick the level's plants as in single player, but the server decides. It checks that the player is within 5 m, the plants have not been picked in that dimension, and the player is not picking too fast. A valid pick gives the herb and 5 Survival XP, and hides the plants for everyone in the dimension. Plants grow back on the world clock, by default in a fifth of the game's time. Nothing is saved, so a restart brings all plants back. Events are gatheringHarvest, which can refuse, and gatheringHarvested.

gathering.herbsWithin()

Gathering.herbsWithin(position, radius, dimension)

The level's herbs available to pick within a sphere in a dimension, with no player needed nearby. Each has its kind, the herb it gives, and its position. Picked plants that have not grown back, removed plants, kinds turned off, and plants a resource placed are left out. Cost grows with the plants inside: on Kutnohorsko, a 50 m sphere takes about 0.2 ms, and a 500 m one, with 145,000 plants, about 100 ms. Invalid arguments throw.

gathering.clearHerbs()

Gathering.clearHerbs(position, radius, dimension)

Removes the level's herbs within a sphere in a dimension, including picked ones, until Gathering.respawn, regrowEverywhere, Area.regrowHerbs or a server restart. It gives no items, XP or harvest events. All games in the dimension hide them, including later joiners. Returns how many were not already removed, so repeating it returns 0. Invalid arguments throw before anything changes.

gathering.regrowTime

regrowTime

The bounds from setRegrowth, as { minHours, maxHours }, or null for the default.

gathering.setRegrowth()

Gathering.setRegrowth(minHours, maxHours)

Makes picked plants grow back after a random time between the bounds, in game hours, up to 87600. Returns false for invalid bounds.

gathering.resetRegrowth()

Gathering.resetRegrowth()

Returns to the default regrowth times.

gathering.respawn()

Gathering.respawn(position, radius, dimension)

Brings back picked and removed plants within a radius at once, including those with regrowth off. Returns how many picks and removals ended. Invalid arguments throw.

gathering.regrowEverywhere()

Gathering.regrowEverywhere(dimension)

Brings back all picked and removed plants in a dimension at once. Returns how many picks and removals ended.

gathering.setNaturalSpawns()

Gathering.setNaturalSpawns(enabled, kind)

Turns the world's natural plants of a kind on or off for all players, including later joiners, or all kinds if left out. Returns how many kinds changed.

gathering.naturalSpawnsOff()

Gathering.naturalSpawnsOff()

The plant kinds now turned off.