Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
So I have 3 command blocks to do something specific, and I'll try to generalize some of the info so nothing is spoiled for the event I've been working on. Anyways.. The idea is that this hopper pops up above a chest, an item spawns above the hopper and then an air block replaces the hopper.

The codes:

/setblock ~1 ~ ~ hopper 0
/summon Item ~1 ~1 ~ {Item:{id:deadbush,Count:1,tag:{display:{Name:"Loot_Key"}}}}
/setblock ~1 ~ ~ air 0

Any chance of making this into one command block line? I've had to break it down into this because just the 1 command block wasn't doing it. And trying to place a chest and put an item inside was also failing.

Any help would be appreciated!
You can do this:
/setblock ~ ~1 ~ minecraft:chest 2 replace {Items:[{Slot:0,id:"minecraft:deadbush",Count:1b,tag:{display:{Name:"Loot Key"}}}]}

99% sure it works.
Are you trying to make an item go into a chest?
If you know which slot exactly the item will go into you can use /replaceitem like so:

Code:
/replaceitem block x y z slot.container.(slot number) minecraft:deadbush 1 0 {display:{Name:"Loot_Key"}}
Those are things I tried, to no avail. I spent 2 hours browsing around various minecraft forums, and the closest I was able to find that actually worked was what I posted. I could get it to generate the chest in the coordinates, but I couldn't get it to put anything in it. I could make it 'give' the player a chest with the item inside, but it does them no good because they won't be able to place the chest down to get the item.
Are you trying this in vanilla or on the server, since what cmdguy/phoenix said should work. It could be that some anti-cheat plugin is preventing the item from being put in the chest.

(Just speculation tho Wink)
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement