Skip to content

To Item

Information
Type Data Function
Namespace moxlib:api/helpers/block/to_item
Versions 1.15+

Overview

Converts a block's id, to it's item equivalent, if possible.

Example

data modify storage moxlib:api/helpers/block/to_item target set value "minecraft:redstone_wire"
function moxlib:api/helpers/block/to_item
Output of storage moxlib:api/helpers/block/to_item
{
  output: "minecraft:redstone_dust"
}

API

Expects

A namespaced block id.

Returns

Namespaced id of the item equivalent of target block.