public async void OnOtherMessage(IServerConsole console, ServerMessage message) { string deathMessage = MatchesDeathMessage(message.Text); if (deathMessage == null) { return; } console.SendCommand("save-all", false, false); await Task.Delay(3000); string player = message.Text.Split(' ')[0].Trim(); if (!File.Exists(Path.Combine(console.Server.WorkingDirectory, "usercache.json"))) { return; } var items = JsonConvert.DeserializeObject <UserCacheItem[]>(File.ReadAllText(Path.Combine(console.Server.WorkingDirectory, "usercache.json"))); string uuid = null; foreach (UserCacheItem item in items) { if (item.Name == player) { uuid = item.UUID; } } if (uuid == null) { return; } bool worldPropertyExists = console.Server.TryGetProperty("level-name", out string world); if (!worldPropertyExists) { return; } string playerData = Path.Combine(console.Server.WorkingDirectory, world, $"playerdata/{uuid}.dat"); if (!File.Exists(playerData)) { return; } var data = new NbtFile(playerData).RootTag.Get <NbtList>("Pos"); console.SendCommand(CommandHelper.Tellraw("@a", new MinecraftTextComponent($"[Death Location] {player} died at approximately ({string.Join(", ", data.Select(x => (int)x.DoubleValue))})", MinecraftColor.light_purple)), true, false); }