Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1.         public static void ResetLoot(Level level)
  2.         {
  3.             BlockCoordinates[] chests =
  4.             {
  5.                 new BlockCoordinates(1007, 80, 209)
  6.             };
  7.             foreach (var chest in chests)
  8.             {
  9.                 Inventory inventory = level.InventoryManager.GetInventory(chest);
  10.                 var compound = inventory.BlockEntity.GetCompound()
  11.                 NbtList items = new NbtList("Items");
  12.                 items.Add(new NbtCompound
  13.                 {
  14.                     new NbtByte("Slot", 2),
  15.                     new NbtShort("id", 1),
  16.                     new NbtShort("Damage", 0),
  17.                     new NbtByte("Count", 10)
  18.                 });
  19.                 compound["Items"] = items;
  20.                 inventory.BlockEntity.SetCompound(compound);
  21.             }
  22.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement