EntityRef item = inventory.itemSlots.get(slot);
ItemComponent itemComponent = item.getComponent(ItemComponent.class);
byte oldSize = itemComponent.stackCount;
itemComponent.stackCount = (byte) newCount;
item.saveComponent(itemComponent);
entity.send(new InventorySlotStackSizeChangedEvent(slot, oldSize, newCount));
}