@ReceiveEvent(components = InventoryComponent.class)
public void onPlayerSpawnedEvent(OnPlayerSpawnedEvent event, EntityRef player) {
BlockItemFactory blockFactory = new BlockItemFactory(entityManager);
// Goodie chest
EntityRef chest = blockFactory.newInstance(blockManager.getBlockFamily("core:chest"));
chest.addComponent(new InventoryComponent(30));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:companion"), 99));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:brick:engine:stair"), 99));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:Tnt"), 99));
inventoryManager.giveItem(chest, EntityRef.NULL, entityManager.create("core:railgunTool"));
inventoryManager.giveItem(chest, EntityRef.NULL, entityManager.create("core:mrbarsack"));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:Brick"), 99));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:Ice"), 99));
inventoryManager.giveItem(chest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:Plank"), 99));
EntityRef doorItem = entityManager.create("core:door");
ItemComponent doorItemComp = doorItem.getComponent(ItemComponent.class);
doorItemComp.stackCount = 20;
doorItem.saveComponent(doorItemComp);
inventoryManager.giveItem(chest, EntityRef.NULL, doorItem);
// Inner goodie chest
EntityRef innerChest = blockFactory.newInstance(blockManager.getBlockFamily("core:Chest"));
innerChest.addComponent(new InventoryComponent(30));
inventoryManager.giveItem(innerChest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:lava"), 99));
inventoryManager.giveItem(innerChest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:water"), 99));
inventoryManager.giveItem(innerChest, EntityRef.NULL, blockFactory.newInstance(blockManager.getBlockFamily("core:Iris"), 99));