I am trying to make a custom crafting datapack for Minecraft. I have found some tutorials that show me how, but all of them use droppers that craft the item instantly after putting the items in. currently i have a chest that crafts the items but I want to be able to detect once a player has taken out the crafted item so I can delete the items used in the recipe.

  • What item are you crafting? Does it have tags, custom name. What slot?
    – QmegaMax
    Feb 12 '21 at 8:20
  • the recipe i am using to test is a diamond in slot 1b and a nether star in slot 10b. it gives me a netherite block in 15b i just want to know how to detect once the player has taken the netherite block so i can get rid of the items used for the recipe. it doesn't have any tags or custom name.
    – Jordan
    Feb 12 '21 at 22:09

This should work:

execute unless data block 785 61 526 {Items:[{Slot:15b,id:"minecraft:netherite_block"}]} run say taken

If you want to empty the chest use:

data merge block 785 61 526 {Items:[]}
  • this works and is awesome but how would this work if I had multiple recipes? if I run this under tick it will reset the chest all the time which would give the player no time to even craft the item.
    – Jordan
    Feb 17 '21 at 2:40
  • so u want to delete only certan items?
    – QmegaMax
    Feb 18 '21 at 9:06
  • no. but if i run this command every tick it will delete all the items once you put them in the chest because there isn't a netherite block in slot 15 yet. this would give the player no time to put in the items to craft the netherite block.
    – Jordan
    Feb 18 '21 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.