> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/contributor/contributor-es/runtime-de-la-escena/modulos-de-runtime/restricted-actions.md).

# Acciones restringidas

El `RestrictedActions` módulo permite a las escenas acceder a funcionalidades sensibles (y por tanto restringidas). Está vinculado al [`sistema de permisos`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) que las escenas usan para solicitar el uso de métodos individuales.

```ts
const RestrictedActions = require("~system/RestrictedActions");
```

{% hint style="info" %}
Como implementador de World Explorer, tu runtime podría no aplicar ninguna restricción de permisos. Nosotros **recomendamos encarecidamente** que no lo hagas, ya que pone a los jugadores en peligro.
{% endhint %}

La mayor parte de la funcionalidad restringida es proporcionada por este módulo, pero también hay [funciones globales restringidas](https://github.com/decentraland/docs/blob/main/contributor/globals/README.md).

El módulo contiene los siguientes métodos y tipos:

* [`function movePlayerTo`](#movePlayerTo)
* [`function teleportTo`](#teleportTo)
* [`function triggerEmote`](#triggerEmote)
* [`function changeRealm`](#changeRealm)
* [`function openExternalUrl`](#openExternalUrl)
* [`function openNftDialog`](#openNftDialog)
* [`function setCommunicationsAdapter`](#setCommunicationsAdapter)
* [`interface Vector3`](#Vector3)

### Métodos

Cada uno de los métodos abajo está asociado con un [sistema de permisos](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) que puede ser solicitado en el manifiesto de la escena.

**`movePlayerTo`**

Desplaza al jugador a una nueva posición relativa a la actual, y opcionalmente establece el objetivo de la cámara con [vectores](#Vector3).

Requiere el [`ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) permiso.

```ts
interface Request {
  newRelativePosition: Vector3;
  cameraTarget?: Vector3;
}

interface Response {
    // Una vez que el jugador se haya movido a la nueva posición, y si el jugador no interrumpió el movimiento, esto será true.
  success: boolean;
}

function movePlayerTo(Request): Promise<Response>;
```

**`teleportTo`**

Reubica al jugador en una ubicación absoluta del mundo dada por un [vectores](#Vector3).

En lugar de requerir un permiso preaprobado, cada llamada a `teleportTo` debe ser aprobada por el jugador.

```ts
interface Request {
  worldPosition: Vector3;
}

interface Response {}

function teleportTo(Request): Promise<Response>;
```

**`triggerEmote`**

Hace que el avatar del jugador muestre una animación de emote, usando uno de los nombres predefinidos.

Requiere el [`ALLOW_TO_TRIGGER_AVATAR_EMOTE`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) permiso.

```ts
interface Request {
  predefinedEmote: string;
}

interface Response {}

function triggerEmote(Request): Promise<Response>;
```

**`openExternalUrl`**

Ofrecer mostrar un sitio web al jugador, usando una UI apropiada (que puede ser otra aplicación).

Requiere el [`OPEN_EXTERNAL_LINK`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) permiso.

```ts
interface Request {
  url: string;
}

interface Response {
  // Si el jugador autorizó abrir el enlace.
  success: boolean;
}

function openExternalUrl(Request): Promise<Response>;
```

**`openNftDialog`**

Mostrar información sobre un NFT al jugador, usando una UI apropiada.

```ts
interface Request {
  // El URN del NFT.
  urn: string;
}

interface Response {
  // Si el NFT fue localizado correctamente y se refirió a una imagen o video.
  success: boolean;
}

function openNftDialog(Request): Promise<Response>;
```

**`changeRealm`**

Cambiar el World Explorer a otro servidor de contenido, usando su URL base.

```ts
interface Request {
  // La URL del nuevo realm.
  realm: string;

  // Un mensaje opcional para mostrar a los usuarios cuando tengan que aprobar el cambio.
  message?: string;
}

interface Response {
  // Si el cambio de realm fue autorizado y exitoso.
  success: boolean;
}

function changeRealm(Request): Promise<Response>;
```

### Tipos

El único tipo adicional usado por los métodos de este módulo es el `Vector3`.

**`Vector3`**

Contiene una posición 3D relativa o absoluta.

```ts
interface Vector3 {
  x: number;
  y: number;
  z: number;
}
```


---

# 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:

```
GET https://docs.decentraland.org/contributor/contributor-es/runtime-de-la-escena/modulos-de-runtime/restricted-actions.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.
