> 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-ko/scene-runtime/runtime-modules/players.md).

# 플레이어

그 `플레이어` 모듈은 허용합니다 [장면들](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/scenes/README.md) 주변 환경에서 플레이어를 찾고, 그들의 신원과 [프로필](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/profiles/README.md).

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

다음 메서드와 타입을 포함합니다:

* [`함수 getPlayersInScene`](#getPlayersInScene)
* [`함수 getConnectedPlayers`](#getPlayersInScene)
* [`함수 getPlayerData`](#getPlayerData)
* [`인터페이스 Player`](#Player)
* [`인터페이스 UserData`](#UserData)

### 메서드

이 모듈에는 장면에서 플레이어를 찾는 두 가지 메서드와, 프로필을 가져오는 한 가지 메서드가 있습니다.

**`getPlayersInScene`**

반환합니다 [`플레이어`](#Player) 배열이며, 각 항목은 `userId` 다음에 사용할 수 있는 [getPlayerData](#getPlayerData).

```ts
인터페이스 Request {}

인터페이스 Response {
  players: Player[];
}

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

**`getConnectedPlayers`**

```ts
인터페이스 Request {}

인터페이스 Response {
  players: Player[];
}

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

**`getPlayerData`**

다음을 반환합니다 [`UserData`](#UserData) 주어진 값에 대해 알려져 있다면, 사용자에 대한 `userId`.

```ts
interface Request {
  // 사용자 식별자(게스트가 아닌 경우에는 이더리움 주소).
  userId: string;
}

인터페이스 Response {
  // 이 사용자의 프로필 정보(사용 가능한 경우).
  data?: UserData;
}

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

### 타입

이 모듈에는 두 가지 타입만 있습니다: [`플레이어`](#Player) 및 [`UserData`](#UserData).

**`플레이어`**

다음에 대한 참조를 보관합니다 `userId`.

```ts
interface Player {
  // 사용자 식별자(게스트가 아닌 경우에는 이더리움 주소).
  userId: string;
}
```

**`UserData`**

사용자, 그들의 신원과 아바타에 대한 정보(부분적일 수 있음)를 담고 있습니다.

World Explorers는 이 정보를 다음을 통해 가져옵니다 [콘텐츠 시스템](https://github.com/decentraland/docs/tree/main/contributor/content/overview/README.md).

그 [프로필 엔티티 정의](https://github.com/decentraland/docs/tree/main/contributor/content/entity-types/profiles/README.md) 이러한 모든 필드와 그 이상을 자세히 설명합니다. 구조와 키는 `UserData` 약간 다르지만, 각 필드의 의미는 동일합니다.

```ts
export interface UserData {
  // 사용자 식별자(즉, 이더리움 주소).
  userId: string;

  // UI에서 부를 이름.
  displayName: string;

  // 서명에 사용하는 이더리움 공개 키.
  publicKey?: string;

  // 웹3 기능이 활성화되어 있는지 여부.
  hasConnectedWeb3: boolean;

  // 이 정보의 순차적 버전으로, 사용자 업데이트마다 증가합니다.
  version: number;

  // 가능한 경우 아바타에 대한 정보.
  avatar?: {
    // 이 아바타를 렌더링하는 데 필요한 자산에 대한 포인터.
    bodyShape: string;
    wearables: string[];

    // 신체 부위별 HEX 인코딩된 RGB/RGBA 색상 틴트.
    skinColor: string;
    hairColor: string;
    eyeColor: string;

    // 이 아바타의 "사진"에 대한 파일 식별자.
    snapshots?: {
      face256: string;
      body: string;
    };
  };
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/contributor/contributor-ko/scene-runtime/runtime-modules/players.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
