dev.polymodloader.api.tag
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
TagKey | record | Names a tag of one registry, for example the block tag #minecraft:mineable/pickaxe. |
TagRegistry | enum | The registries whose entries tags can group. |
TagView | interface | Reads the tags the game loaded: on the server from its data packs, on the client the copy the server sent. |
TagKey
record · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
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.
| Component | Type | Description |
|---|---|---|
registry | TagRegistry | what the tag groups |
id | ResourceId | the tag's ID, without the # |
block(ResourceId)
public static TagKey block(ResourceId id)
Since 0.1.0-alpha.4 or earlier
A block tag, for example TagKey.block(ResourceId.minecraft("mineable/pickaxe")).
| Parameter | Type | Description |
|---|---|---|
id | ResourceId | — |
Returns TagKey
item(ResourceId)
public static TagKey item(ResourceId id)
Since 0.1.0-alpha.4 or earlier
An item tag, for example TagKey.item(ResourceId.minecraft("logs")).
| Parameter | Type | Description |
|---|---|---|
id | ResourceId | — |
Returns TagKey
entityType(ResourceId)
public static TagKey entityType(ResourceId id)
Since 0.1.0-alpha.4 or earlier
An entity type tag, for example TagKey.entityType(ResourceId.minecraft("skeletons")).
| Parameter | Type | Description |
|---|---|---|
id | ResourceId | — |
Returns TagKey
toString()
public String toString()
Since 0.1.0-alpha.4 or earlier
The tag as written in commands and data files, for example #minecraft:logs.
Returns String
TagRegistry
enum · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
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.
| Constant | Description |
|---|---|
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()
Since 0.1.0-alpha.4 or earlier
The folder under tags/ that holds this registry's tag files, for example block.
Returns String
TagView
interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
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)
Since 0.1.0-alpha.4 or earlier
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.
| Parameter | Type | Description |
|---|---|---|
tag | TagKey | — |
entry | ResourceId | — |
Returns boolean
entries(TagKey)
List<ResourceId> entries(TagKey tag)
Since 0.1.0-alpha.4 or earlier
Every entry of the tag, nested tags resolved, in the game's order; empty for an unknown tag.
| Parameter | Type | Description |
|---|---|---|
tag | TagKey | — |
Returns List<ResourceId>