> For the complete documentation index, see [llms.txt](https://nightexpress.gitbook.io/sunlight/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nightexpress.gitbook.io/sunlight/modules/random-teleport-rtp.md).

# 🌐 Random Teleport (RTP)

Provides basic random teleport feature.

## Commands & Permissions

* [Commands](/sunlight/general/commands.md#rtp-module) link.
* [Permissions](/sunlight/general/permissions.md#rtp-module) link.

## Features

* ✅ **Default World**. Set default world to search location when player is in unsupported world.
* ✅ **Attempts Amount**. Set how many attempts can be made to find a valid location.
* ✅ **Generated Chunks Only**. Set whether or not RTP should search location in generated chunks only.
* ✅ **Loaded Chunks Only**. Set whether or not RTP should search location in loaded chunks only.
* ✅ **Per World Ranges**. Set different search distance for each world.
* ✅ **Start X & Z Values**. Set start X and Z values for location search.
* ✅ **Min & Max Distance**. Set min. and max. distance for X, Z coordinates.
* ✅ **Directions**. Set directions used in location search, such as west, east, south, north.

## Configuration

### Generated Chunks Only

The `Generated_Chunks_Only` setting is recommended to be set on `true` in the following cases:

* You have a **full pregenerated** world map.
* You have a **large**/**unlimited** world map with **pregenerated spawn chunks** within an RTP world's range.

Do **not** enable this setting if you have unlimited world without pregenerated chunks, or if you're using plugins that deletes/refreshes "old" chunks (e.g. Regionerator). Otherwise you will barely get this module to work.

### Loaded Chunks Only

The `Loaded_Chunks_Only` setting is recommended to be set on `true` only if you want players to be teleported in chunks with other players.

Make sure to increase the `Distance_Max` value to cover the most or all your world map for best results.

### World Range(s)

By default is there range settings for the default `world` world.&#x20;

If your primary world's name is different, or you want to make RTP work in other worlds, make sure to include them in the `Ranges` section.

You can provide multiple range settings for each world. The random one of them will be used when player uses RTP.

{% code title="Range settings example" %}

```yaml
Ranges:
  world: # This is the name of your world.
    default: # This is any unique name for range settings.
      Start_X: 0
      Start_Z: 0
      Distance_Min: 100
      Distance_Max: 500
      Directions:
      - WEST
      - SOUTH
      - NORTH
      - EAST
  world_resources:
    '1':
      Start_X: 0
      Start_Z: 0
      Distance_Min: 100
      Distance_Max: 500
      Directions:
      - WEST
      - SOUTH
      - NORTH
      - EAST
    '2':
      Start_X: 1000
      Start_Z: 1000
      Distance_Min: 100
      Distance_Max: 500
      Directions:
      - WEST
      - SOUTH
      - NORTH
      - EAST

```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://nightexpress.gitbook.io/sunlight/modules/random-teleport-rtp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
