π Basic UsageΒΆ
PrerequisitesΒΆ
What is a datapack
What is a function tag
The
.mcfunction
syntax is the same as Smithed syntaxKnowing how to place a custom block, consider using Smithed Custom Block
InstallationΒΆ
Install LanternLoad in your datapack
Copy the
data/itemio
folder into your data packMerge the contents of
ItemIO/data/load/tags/functions/load.json
and your owndata/load/tags/functions/load.json
Adding your first container !ΒΆ
Add a simple container that only accept dirt in the first slot, but only from bottom :
# example:my_block/place
setblock ~ ~ ~ barrel
execute
summon item_display
run function example:my_block/place_entity:
# Define the ioconfig
data modify entity @s item.components."minecraft:custom_data".itemio.ioconfig set value []
data modify entity @s item.components."minecraft:custom_data".itemio.ioconfig append value {
Slot:0b,
mode: "input",
allowed_side:{bottom:1b},
filters:[
{id:["minecraft:dirt"]}
]
}
tag @s add itemio.container # The required tag
tag @s add itemio.container.hopper # To make it work with hoppers
function #itemio:calls/container/init
Full specification
Itβs simple, you just need to define the ioconfig and add the required tags and boom, you have a container that can be used with hoppers.