1
Testing for a chest help
so i am trying make a custom crafting recipe but i was wondering if there was anyway to look if there is a named chest (or in my case a dispenser) with items in it?
thanks ~ EnderCat
thanks ~ EnderCat
Create an account or sign in to comment.
14
1
bump
1
bump
1
hey guys i got the crafting working but if there is more then one in the world it makes it so all of them get what comes out of it (i am useing /blockdata to do it) please help
1
is there any way to make a spawn egg that will kill that armor stand but ONLY that armor stand? (p.s. it will work if i can put a enchented item in the crafting table named remove and if that works i will do it)
Edit:oh and btw how do you do /replace item on that dispenser? and can you have more then one crafting table and have it work?
Edit:oh and btw how do you do /replace item on that dispenser? and can you have more then one crafting table and have it work?
1
Yea forsure
/scoreboard players add @e[type=Item] dropped 1 {Item:{id:"minecraft:crafting_table"},OnGround:1b}
/execute @e[score_dropped_min=1] ~ ~ ~ /setblock ~ ~ ~ dispenser 1
/execute @e[score_dropped_min=1] ~ ~ ~ /blockdata ~ ~ ~ {CustomName:hi}
/kill @e[score_dropped_min=1]
1
EnderCat17so i am trying make a custom crafting recipe but i was wondering if there was anyway to look if there is a named chest (or in my case a dispenser) with items in it?
thanks ~ EnderCat
Yea in this case I'd use a invisible Armor stand to check for items. I'm going to guess you already have the way you add your custom crafting machine into the world, also I'm sure you want to check for specific items instead of any item.
So using this code
/summon ArmorStand ~ ~ ~ {CustomName:customcraft,Invisible:1,Marker:1,Invulnerable:1,NoGravity:1}
/execute @e[name=customcraft] ~ ~-1 ~ detect ~ ~ ~ /testforblock ~ ~ ~ dispenser -1 {Items:[{id:minecraft:stick,Damage:0s,Slot:0b,Count:1b}]}
the best way to get this code is by placing a command block over the dispenser with this code /blockdata ~ ~-1 ~ {} then copy all the code place in the testforblock data spot1
anyone know how to set a block at a dropped crafting table?
1
add a scoreboard dummy,
scoreboard objectives add dropped dummy
scoreboard objectives add dropped dummy
/scoreboard players add @e[type=Item] dropped 1 {Item:{id:"minecraft:crafting_table"},OnGround:1b}
/execute @e[score_dropped_min=1] ~ ~ ~ /setblock ~ ~ ~ bedrock
/kill @e[score_dropped_min=1]
1
thank you so much but is there anyway to change that bedrock into a named dispenser facing up?
1
Yeah, there is no way to automatically check throughout the whole world. The best you could do would be to spawn an invisible armor stand or something wherever a player puts down one of the dispensers (How you detect that is up to you really). That way you could execute a testforblock on all the armor stands.
1
eeehm no...
the only way to do that is to use
/execute @a ~ ~ ~ detect <block> <subid> <command>
there is no datatag part included in that command, so you won't be able to test for items
the only way to do that is to use
/execute @a ~ ~ ~ detect <block> <subid> <command>
there is no datatag part included in that command, so you won't be able to test for items
1
You can /testforblock a dropper with items using the 'Items' tag:
To add more items, just add more sets of {} inside the square brackets, and put and id and slot number in for each one. id's should be surrounded by quotes and have 'minecraft:' in front of them (i.e. "minecraft:stone"). Slot numbering starts at 0, and I'm not sure exactly what order they go up from there. I'd assume they start in the bottom left, then go up going to the right, and then jump to the next row up. You may have to play around a bit if I'm wrong.
testforblock x y z dropper -1 {Items:[{id:"<first item name here>",Slot:<slot number here>},{<same formatting as the first item>}]}
To add more items, just add more sets of {} inside the square brackets, and put and id and slot number in for each one. id's should be surrounded by quotes and have 'minecraft:' in front of them (i.e. "minecraft:stone"). Slot numbering starts at 0, and I'm not sure exactly what order they go up from there. I'd assume they start in the bottom left, then go up going to the right, and then jump to the next row up. You may have to play around a bit if I'm wrong.
1
i have done this but i was wondering if there was a way to look through the WHOLE world for it (btw the slots start from right top)
1
You could always set up a line of command blocks checking throughout a big area (individually) for that chest and stuff. Not sure, not that good with redstone.