NamespacedKey - Get (Expression) — SkBee

Addon: SkBee · Category: Expression · Since: 2.6.0

Syntax

(minecraft|mc|namespaced|resource)[ ](key|id[entifier]|location)[s] [(from|of)] %objects%

Description

Get the namespaced key of an object or from a string. Note when getting key from string: - NamespacedKeys are a string based key which consists of two components - a namespace and a key (ex: "namespace:key"). - Namespaces may only contain lowercase alphanumeric characters, periods, underscores, and hyphens. - Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes. - Minecraft uses the "minecraft:" namespace for built in objects. - If a namespace is not provided, the Minecraft namespace will be used by default -> "minecraft:your_key" - Keys may only contain lowercase alphanumeric characters, periods, underscores, hyphens, and forward slashes. - Keep an eye on your console when using namespaced keys as errors will spit out when they're invalid. For more info please check out [**Identifier**](https://minecraft.wiki/w/Identifier) on McWiki.

Examples

set {_key} to mc key of target block
set {_key} to namespaced key of player's tool
set {_key} to minecraft key of biome at player
set {_n} to namespaced key from "minecraft:log"
set {_custom} to namespaced key from "my_server:custom_log"
set {_n} to namespaced key from "le_test"

View source