dev.polymodloader.api.tag
이 페이지는 소스의 Javadoc에서 ./gradlew apiReference로 만든 것입니다. 설명은 코드에 적힌 영어 그대로입니다. 직접 고치지 말고 소스의 주석을 고친 뒤 다시 만드세요.
| 형식 | 종류 | 설명 |
|---|---|---|
TagKey | 레코드 | Names a tag of one registry, for example the block tag #minecraft:mineable/pickaxe. |
TagRegistry | 열거형 | The registries whose entries tags can group. |
TagView | 인터페이스 | Reads the tags the game loaded: on the server from its data packs, on the client the copy the server sent. |
TagKey
레코드 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public record TagKey(TagRegistry registry, ResourceId id)
Names a tag of one registry, for example the block tag #minecraft:mineable/pickaxe. A key is only a name: the tag's entries come from data packs and mod jars ( data/<namespace>/tags/<registry>/<path>.json) and from ContentRegistrar.addToTag, and change on /reload. Query them through TagView (WorldView.tags()) or the isIn methods of the views. Create keys once and keep them in constants.
| 구성 요소 | 타입 | 설명 |
|---|---|---|
registry | TagRegistry | what the tag groups |
id | ResourceId | the tag's ID, without the # |
block(ResourceId)
public static TagKey block(ResourceId id)
추가된 버전 0.1.0-alpha.4 또는 그 이전
A block tag, for example TagKey.block(ResourceId.minecraft("mineable/pickaxe")).
| 인자 | 타입 | 설명 |
|---|---|---|
id | ResourceId | — |
반환 TagKey
item(ResourceId)
public static TagKey item(ResourceId id)
추가된 버전 0.1.0-alpha.4 또는 그 이전
An item tag, for example TagKey.item(ResourceId.minecraft("logs")).
| 인자 | 타입 | 설명 |
|---|---|---|
id | ResourceId | — |
반환 TagKey
entityType(ResourceId)
public static TagKey entityType(ResourceId id)
추가된 버전 0.1.0-alpha.4 또는 그 이전
An entity type tag, for example TagKey.entityType(ResourceId.minecraft("skeletons")).
| 인자 | 타입 | 설명 |
|---|---|---|
id | ResourceId | — |
반환 TagKey
toString()
public String toString()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The tag as written in commands and data files, for example #minecraft:logs.
반환 String
TagRegistry
열거형 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public enum TagRegistry
The registries whose entries tags can group. A tag's file lives in data/<namespace>/tags/<directory>/<path>.json of a data pack or mod jar.
| 상수 | 설명 |
|---|---|
BLOCK | Blocks, such as #minecraft:mineable/pickaxe. |
ITEM | Items, such as #minecraft:logs. |
ENTITY_TYPE | Entity types, such as #minecraft:skeletons. |
directory()
public String directory()
추가된 버전 0.1.0-alpha.4 또는 그 이전
The folder under tags/ that holds this registry's tag files, for example block.
반환 String
TagView
인터페이스 · 안정성 PREVIEW · 추가된 버전 0.1.0-alpha.4 또는 그 이전
public interface TagView
Reads the tags the game loaded: on the server from its data packs, on the client the copy the server sent. Obtained from WorldView.tags().
Thread: the thread of the world that handed it out. When: once a world is loaded; results change after /reload, so do not cache them across reloads.
contains(TagKey, ResourceId)
boolean contains(TagKey tag, ResourceId entry)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Whether entry (a block, item, or entity type ID, matching the tag's registry) is in the tag, including through nested tags. An unknown tag or entry is simply not contained.
| 인자 | 타입 | 설명 |
|---|---|---|
tag | TagKey | — |
entry | ResourceId | — |
반환 boolean
entries(TagKey)
List<ResourceId> entries(TagKey tag)
추가된 버전 0.1.0-alpha.4 또는 그 이전
Every entry of the tag, nested tags resolved, in the game's order; empty for an unknown tag.
| 인자 | 타입 | 설명 |
|---|---|---|
tag | TagKey | — |
반환 List<ResourceId>