# Generator

### Functions

#### setCooldown(cooldown: number)

Sets the cooldown of the generator (in seconds). This is how many seconds passes in-between item drops. Defaults to 20 seconds.

#### setItem(itemType: [ItemType](/scripting/bedwars-scripting/types/itemtype.md))

Sets the type of item that is dropped by the generator.

#### setMax(max: number)

Sets the max stack size that the generator can hold. Once the max stack size is reached, no more items will be generated until the items are picked up. Defaults to 10.

#### setPosition(position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3))

Sets the position of the generator.

#### getPosition(): [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)

Returns the position of the generator.

#### dropItem(itemType: [ItemType](/scripting/bedwars-scripting/types/itemtype.md))

Immediately drops an item from the generator.

#### destroy()

Destroys the generator.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.easy.gg/scripting/bedwars-scripting/objects/generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
