# 🌐 Random Teleport (RTP)

Provides basic random teleport feature.

## Commands & Permissions

* [Commands](https://nightexpress.gitbook.io/sunlight/general/commands#rtp-module) link.
* [Permissions](https://nightexpress.gitbook.io/sunlight/general/permissions#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: 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://nightexpress.gitbook.io/sunlight/modules/random-teleport-rtp.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.
