Advertisement
justync7

spawner

Jul 2nd, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. p=peripheral.wrap("left")
  2. w=p.getWorld(0)
  3.  
  4. print("ID:")
  5. itemid=tonumber(read())
  6.  
  7. print("META:")
  8. meta=tonumber(read())
  9.  
  10. print("X:")
  11. x=tonumber(read())
  12.  
  13. print("Y:")
  14. y=tonumber(read())
  15.  
  16. print("Z:")
  17. z=tonumber(read())
  18.  
  19. -- Create a chest
  20. w.setBlock(x, y, z, 54, 0)
  21.  
  22. -- Get an NBT table representing the contents of the chest
  23. local te = w.getTileEntity(x, y, z)
  24. local nbt = readTileNBT(te)
  25.  
  26. -- Add a stack of bedrock in slot 0
  27. table.insert(nbt.value.Items.value, {type="compound", value={id={type="short", value=itemid}, Count={type="byte", value=64}, Damage={type="short", value=0}, Slot={type="byte", value=0}}})
  28.  
  29. writeTileNBT(te, nbt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement