2

I am creating an adventure map and players will need items every so often so I am using

/summon FallingSand 2140.5 9 -423.5 {TileID:54,Time:1,TileEntityData:{Items:[{id:diamond_helmet,Slot:0,Count:1},{id:diamond_chestplate,Slot:1,Count:1},{id:diamond_leggings,Slot:2,Count:1},{id:diamond_boots,Slot:3,Count:1},{id:diamond_sword,Slot:4,Count:1}]}} 

To summon a chest with the items in it. When the chest spawns it auto-faces South, is there a way using datatags to make it face North?

  • 1
    Why are you summoning a falling sand entity instead of using setblock? As a bonus, using setblock will solve your problem. – MBraedley Oct 14 '15 at 0:10
  • @MBraedley Can you please answer the question with a command using /setblock that will fix my error? – David Oct 14 '15 at 0:13
  • 1
    It's going to be hard for me to provide a meaningful answer if you don't answer my question first. There's good reasons why you might use falling sand instead of setblock. As it turns out, you are able to do what you want with falling sand, but the more important point is that you seem to be stuck in the X/Y problem. You're assuming the solution, at least with your title, instead of focusing on the problem. – MBraedley Oct 14 '15 at 1:20
  • @DavidCole this might be useful gaming.stackexchange.com/questions/191936/… – Ben Oct 14 '15 at 1:21
  • As a side-note, TileID is kind of deprecated in 1.8, the Block tag should be used instead. – MrLemon Oct 14 '15 at 10:10
1

The facing of a chest is determined by it's block data value, ranging from 2 to 5 (North, South, West, East). For Falling Sand Entities the data value of the block can be set by adding a Data tag to the entity:

/summon FallingSand 2140.5 9 -423.5 {Block:minecraft:chest,Data:2,Time:1,TileEntityData:{Items:[{id:diamond_helmet,Slot:0,Count:1},{id:diamond_chestplate,Slot:1,Count:1},{id:diamond_leggings,Slot:2,Count:1},{id:diamond_boots,Slot:3,Count:1},{id:diamond_sword,Slot:4,Count:1}]}}

(I also replaced TileID with the newer Block. This doesn't exactly matter, but numerical IDs are being phased out gradually, and I expect TileID to break in the future.)


However, as pointed out by MBraedley in the comments, summoning a chest with items can be done directly via setblock, rather than using the old roundabout way of summoning falling sand.

The syntax is

/setblock <x> <y> <z> <TileName> [dataValue] [oldBlockHandling] [dataTag] 

Here, the data value can be set directly. To set the data tag, you'll need to specify oldBlockHandling, I suggest using the default value of replace:

/setblock 2140 9 -423 minecraft:chest 2 replace {Items:[{id:diamond_helmet,Slot:0,Count:1},{id:diamond_chestplate,Slot:1,Count:1},{id:diamond_leggings,Slot:2,Count:1},{id:diamond_boots,Slot:3,Count:1},{id:diamond_sword,Slot:4,Count:1}]}

This command is not only shorter and easier to read, it also executes much faster than the summon version. That is because it doesn't need to create an entity, have it drop to the floor, determine collision, and then turn it into a block and remove the entity.

| improve this answer | |

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.