async Task IHandle <PlayerLoggedIn> .Handle(PlayerLoggedIn message) { var generator = AttachedObject.GetComponent <ClientboundPacketComponent>().GetGenerator(); // PositionAndLook var position = AttachedObject.GetEntityWorldPosition(); var lookComponent = AttachedObject.GetComponent <EntityLookComponent>(); await generator.PositionAndLook(position.X, position.Y, position.Z, lookComponent.Yaw, lookComponent.Pitch, 0, AttachedObject.GetComponent <TeleportComponent>().StartNew()); // Health var healthComponent = AttachedObject.GetComponent <HealthComponent>(); var foodComponent = AttachedObject.GetComponent <FoodComponent>(); await generator.UpdateHealth(healthComponent.Health, healthComponent.MaxHealth, foodComponent.Food, foodComponent.MaxFood, foodComponent.FoodSaturation); // Experience var expComponent = AttachedObject.GetComponent <ExperienceComponent>(); await generator.SetExperience(expComponent.ExperienceBar, expComponent.Level, expComponent.TotalExperience); // Inventory var slots = await AttachedObject.GetComponent <InventoryComponent>().GetInventoryWindow().GetSlots(AttachedObject); await generator.WindowItems(0, slots); InstallPropertyChangedHandlers(); }