NBT - Item with NBT (Expression) — SkBee

Addon: SkBee · Category: Expression · Since: 1.0.0

Syntax

%itemtype% with [custom] [[item( |-)]nbt] %nbtcompound%

Description

Get an item with nbt. NOTE: The NBT in the examples represents NBT for Minecraft 1.20.5+ NOTE: The optional `custom` syntax will place nbt in the `"minecraft:custom_data"` component (1.20.5+ only).

Examples

give player diamond sword with nbt from "{""minecraft:food"":{nutrition:10,saturation:2.0f}}"
set {_n} to nbt from "{custom_data:{points:10}}"
set {_i} to netherite axe with nbt {_n}
give player diamond pickaxe with nbt from "{""minecraft:damage"":500}"
give player 30 apples with nbt from "{""minecraft:max_stack_size"":10}"

#These two have the same outcome, just showing the use of `custom` and how it places in the custom_data component.
give player diamond sword with nbt from "{""minecraft:custom_data"":{points:10}}"
give player diamond sword with custom nbt from "{points:10}"

View source