Skip to main content
Version: Minecraft 26.2

dev.polymodloader.api.tag

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

TypeKindDescription
TagKeyrecordNames a tag of one registry, for example the block tag #minecraft:mineable/pickaxe.
TagRegistryenumThe registries whose entries tags can group.
TagViewinterfaceReads 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.

ComponentTypeDescription
registryTagRegistrywhat the tag groups
idResourceIdthe 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")).

ParameterTypeDescription
idResourceId—

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")).

ParameterTypeDescription
idResourceId—

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")).

ParameterTypeDescription
idResourceId—

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.

ConstantDescription
BLOCKBlocks, such as #minecraft:mineable/pickaxe.
ITEMItems, such as #minecraft:logs.
ENTITY_TYPEEntity 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.

ParameterTypeDescription
tagTagKey—
entryResourceId—

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.

ParameterTypeDescription
tagTagKey—

Returns List<ResourceId>

Buy me a coffee