Skip to content

API reference Obsidian.API.Registries

TagKey record struct

Names a tag by its registry and identifier, like Fabric's and NeoForge's tag keys; looking it up gives the tag as it is now, with what plugins added to it.

public readonly record struct TagKey : IEquatable<TagKey>

In Obsidian.API.

Constructors

TagKey(string, string)

public TagKey(string Registry, string Identifier);

Names a tag by its registry and identifier, like Fabric's and NeoForge's tag keys; looking it up gives the tag as it is now, with what plugins added to it.

Parameters

Registry
The tag's registry, like block.
Identifier
The tag's identifier, like c:ores.

Properties

Identifier

public string Identifier { get; init; }

The tag's identifier, like c:ores.

Registry

public string Registry { get; init; }

The tag's registry, like block.

Methods

Contains(IBlock)

public bool Contains(IBlock block);

Whether a block is in the tag, for a block tag.

Contains(IEntity)

public bool Contains(IEntity entity);

Whether an entity's type is in the tag, for an entity type tag.

Contains(int)

public bool Contains(int id);

Whether the registry entry with the given id is in the tag; false while the tag doesn't exist.

TryGet(Tag)

public bool TryGet(out Tag tag);

Finds the tag.

On this page