Minecraft Wiki
가입하기
Advertisement

리소스 위치(Resource location) (이름공간 ID, 이름공간 식별자, 리소스 식별자,[1] 이름공간 문자열[2]등으로 불림)는 잠재적인 모호성이나 충돌 없이 Minecraft의 기본적인 오브젝트를 선언하고 식별하는 방법이다.

사용[]

리소스 위치는 블록아이템, 개체 종류, 제작법, 함수, 발전 과제, 태그Minecraft의 기본 오브젝트를 참조하기 위한 일반 문자열로 표현한다. 흥미롭게도, 블록 상태는 리소스 위치를 사용하지 않는다.

올바른 리소스 위치는 이름공간:경로의 형식으로 사용되며, 이 형식은 특정 문자열만 사용할 수 있다.

리소스 위치를 사용하는 콘텐츠 목록:

내장되어 있는 레지스트리
데이터 팩 컨텐츠‌[Java Edition 전용]
  • 발전 과제
  • 노획물 목록
  • 함수
  • 구조물 파일
  • 제작법
  • 블록/유체/아이템/개체 형식/함수 태그
애드온 컨텐츠‌[Bedrock Edition 전용]
  • 노획물 목록
  • 함수
리소스 팩 컨텐츠‌[Java Edition 전용]
  • 블록 상태 파일
  • 모델
  • 텍스쳐
  • 소리
기타 사용자 정의 가능한 콘텐츠‌[Java Edition 전용]
  • 보스바
  • 명령 저장
제삼자 기능 없이 사용자 정의가 불가능한 콘텐츠
  • 함수 노획물
  • 노획물 조건
  • 노획물 형식
  • 명령 인수 유형

문자 법칙[]

Java Edition[]

리소스 위치의 이름공간은 다음 문자열만 사용되어야 한다.

  • 0123456789 숫자
  • abcdefghijklmnopqrstuvwxyz 영어 소문자
  • _ 밑줄 문자
  • - 빼기 기호
  • .

밑의 문자열은 이름공간에서는 사용될 수 없지만 경로에서 사용될 수 있다.

  • / 빗금 (디렉토리 분리)

이름공간과 경로의 기본적인 명명 규칙은 snake_case을 따른다.

Bedrock Edition[]

이름공간과 ID의 경로는 빗금과 쌍점(:)을 제외한 모든 기호를 사용할 수 있다.

밑의 문자열은 이름공간에서는 사용될 수 없지만 노획물 목록함수의 경로에서 사용될 수 있다.

  • / 빗금 (디렉토리 분리)

이름공간과 경로의 기본적인 명명 규칙은 snake_case을 따른다.

문자열로 변환[]

리소스 위치는 이름공간 뒤에 :(쌍점)을 붙이고 경로를 추가하여 문자열로 변환한다.

예시:

이름공간 경로 문자열 표현
minecraft diamond minecraft:diamond
foo bar.baz foo:bar.baz
minecraftwiki commands/minecraft_wiki minecraftwiki:commands/minecraft_wiki

문자열에서 변환[]

리소스 위치가 언제나 문자열로 변환될 수 있는 것과는 다르게, 문자열은 일부가 리소스 위치로 변환될 수 없다.

몇몇의 제한 사항:

  • 문자열은 최대 1개의 :(쌍점)만 가질 수 있음.
  • 나머지 문자열은 이 문서의 문자 법칙을 따라야 함.
  • :가 있는 경우, : 이전에 있는 문자열(이름공간 부분)은 / 또는 . 코드가 포함될 수 없음.

:이 존재할 때, : 앞부분이 이름공간이 되고 : 뒷부분이 경로가 된다.

:이 없을 때, minecraft 코드가 이름공간이 되고 문자열 전체가 경로가 된다.‌[Java Edition 전용]

리소스 위치의 문자열에는 :을 포함하는 것이 권장된다.

예시
문자열 이름공간 경로 게임이 읽어들이는 값
bar:code bar code bar:code
minecraft:zombie minecraft zombie minecraft:zombie
diamond minecraft[Java Edition 전용]
None‌[Bedrock Edition 전용]
diamond minecraft:diamond[Java Edition 전용]
diamond[Bedrock Edition 전용]
foo/bar:coal Invalid character /
minecraft/villager minecraft[Java Edition 전용]
None‌[Bedrock Edition 전용]
minecraft/villager minecraft:minecraft/villager[Java Edition 전용]
minecraft/villager[Bedrock Edition 전용]
mypack_recipe minecraft[Java Edition 전용]
None‌[Bedrock Edition 전용]
mypack_recipe minecraft:mypack_recipe[Java Edition 전용]
mypack_recipe[Bedrock Edition 전용]
mymap:schrödingers_var mymap Invalid character ö[Java Edition 전용]
schrödingers_var[Bedrock Edition 전용]
mymap:schrödingers_var[Bedrock Edition 전용]
custom_pack:Capital custom_pack Invalid character C[Java Edition 전용]
Capital[Bedrock Edition 전용]
custom_pack:Capital[Bedrock Edition 전용]

팩에서 콘텐츠 불러오기[]

Information icon
이 기능은 Java Edition 전용입니다. 

Given objects from resource packs and data packs are files, the resource location can also be used to find corresponding files that declared objects of the resource location.

Though the locations varies by object type and the pack type the object type belongs to, there is a pattern to follow. In general, The location is in a fashion of pack_type/namespace/object_type/name.suffix, where all the / (forward slash) symbol (may be part of object_type or name) is replaced by operating system-dependent directory separator.

Note: Certain elements in the resource pack is not necessarily backed by an object with resource location, such as GUI textures.

Given the type of content we want to locate, we can find out the corresponding pack_type, object_type, and suffix. Then, we can substitute in and find out the final file location of the content.

Namespaces[]

Nathan Adams Mojang avatar This isn't a new concept, but I thought I should reiterate what a "namespace" is. Most things in the game has a namespace, so that if we add something and a mod (or map, or whatever) adds something, they're both different somethings. Whenever you're asked to name something, for example a loot table, you're expected to also provide what namespace that thing comes from. If you don't specify the namespace, we default to minecraft. This means that something and minecraft:something are the same thing.
Dinnerbone : namespaces[3]

A namespace is a domain for contents. It is to prevent potential content conflicts or unintentional overrides of object of a same name.

For example, two data packs add two minigame mechanisms to Minecraft; both have a function named start. Without namespaces, these two functions would clash and the minigames would be broken. When they have different namespaces of minigame_one and minigame_two, the functions would become minigame_one:start and minigame_two:start, which no longer conflict.

minecraft namespace[]

Minecraft reserves the minecraft namespace; when a namespace is not specified, a resource location falls back to minecraft[Java Edition 전용]. As a result, the minecraft namespace should only be used by content creators when the content needs to overwrite or modify existing Minecraft data, such as adding a function to the minecraft:load function tag.

Custom namespace[]

The namespace should be distinct for different projects or content creations (e.g. a data pack, a resource pack, a mod, backing data/resource packs for a custom map, etc.)

To prevent potential clashes, the namespace should be as particular as possible.

  • Avoid alphabet soups. For example, a project named "nuclear craft" should not use the namespace nc, as this is too ambiguous.
  • Avoid words that are too vague. battle_royale would not be informative to look up as well, but player_name_battle_royale would be much better.

In either case, these poorly chosen namespaces reduces the exposure of a project and brings difficulties for debugging when there is multiple content creations applied to the game.

Other built-in namespaces[]

The default resource pack of Minecraft declares Realms-oriented language files in the realms namespace (located at assets/realms/lang/<language-code>.json) and game-related language files in the minecraft namespace, even though translation keys are not resource locations. The realms jar itself also declares its en_us.json language file and its various textures in the realms namespace.

In the IDs of command argument types, a brigadier namespace also appears for command argument types that are native to Brigadier.[4]

History[]

Java Edition
1.6.113w21aAdded resource locations alongside the minecraft prefix for identifying assets.
1.7.213w37aCommands now accept name IDs aside from numerical IDs.
1.1116w32aResource locations now have a character restriction.
Disallowed uppercase characters in resource locations.
1.1317w47aAfter the flattening, resource locations are the only accepted form of identifiers.
pre4Resource locations are now used to identify plugin message channels.[5]
1.14.4pre1The realms namespace is added to the client jar's builtin resource pack.
1.1620w14aAttributes are now resource locations.
Pocket Edition 알파
0.16.0build 1Added commands, which supported string IDs. However, these identifiers were not namespaced yet.
Bedrock Edition
1.12.0beta 1.12.0.2IDs are now namespaced using the minecraft prefix, to support custom items being added through add-ons.

함께 보기[]

참조 링크[]

외부 링크[]

Advertisement