TransWikia.com

How to check if a slot of a container block is empty?

Arqade Asked on May 19, 2021

I want to make a custom crafing system using droppers and need to check if certain slots are filled with the correct items. I can’t find a way to check if certain slots are empty though. As not all recipes need every slot to be filled, this can cause wrong items in the unchecked slots to dissapear with the rest. Is it possible to check if a slot is empty somehow?

One Answer

If a dropper slot is empty it means the corresponding compound tag with property Slot does not exist. Use /execute unless data to check if the slot is empty:

execute unless data block 12 23 34 Items[{Slot:0b}] run ...

Correct answer by ExpertCoder14 on May 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP