Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void ResetLoot(Level level)
- {
- BlockCoordinates[] chests =
- {
- new BlockCoordinates(1007, 80, 209)
- };
- foreach (var chest in chests)
- {
- Inventory inventory = level.InventoryManager.GetInventory(chest);
- var compound = inventory.BlockEntity.GetCompound()
- NbtList items = new NbtList("Items");
- items.Add(new NbtCompound
- {
- new NbtByte("Slot", 2),
- new NbtShort("id", 1),
- new NbtShort("Damage", 0),
- new NbtByte("Count", 10)
- });
- compound["Items"] = items;
- inventory.BlockEntity.SetCompound(compound);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement