private void tabSpawnerCreate_Click(object sender, RoutedEventArgs e)
 {
     if (tabSpawner1Type.SelectedIndex < 0)
     {
         tabSpawner1Type.SelectedIndex = 0;
     }
     if (tabSpawner2Type.SelectedIndex < 0)
     {
         tabSpawner2Type.SelectedIndex = 0;
     }
     if (tabSpawner3Type.SelectedIndex < 0)
     {
         tabSpawner3Type.SelectedIndex = 0;
     }
     if (tabSpawner4Type.SelectedIndex < 0)
     {
         tabSpawner4Type.SelectedIndex = 0;
     }
     string firstText = "";
     if (tabSumosType.SelectedIndex == 0)
     {
         //errorC = true;
     }
     if (tabSpawnerAddToInv.IsChecked.Value)
     {
         AllSelData asd = new AllSelData();
         firstText = "";
         if (asd.getAt(tabSpawnerShowType.SelectedIndex) == "TippedArrow")
         {
             if (mcVersion == "1.8") { firstText = "/give @p minecraft:mob_spawner 1 0 {BlockEntityTag:{id:\"MobSpawner\",EntityId:Arrow,SpawnData:{"; }
             else { firstText = "/give @p minecraft:mob_spawner 1 0 {BlockEntityTag:{id:\"MobSpawner\",SpawnData:{id:\"Arrow\","; }
         }
         else
         {
             if (mcVersion == "1.8") { firstText = "/give @p minecraft:mob_spawner 1 0 {BlockEntityTag:{id:\"MobSpawner\",EntityId:" + asd.getAt(tabSpawnerShowType.SelectedIndex) + ",SpawnData:{"; }
             else { firstText = "/give @p minecraft:mob_spawner 1 0 {BlockEntityTag:{id:\"MobSpawner\",SpawnData:{id:\"" + asd.getAt(tabSpawnerShowType.SelectedIndex) + "\","; }
         }
     }
     else
     {
         AllSelData asd = new AllSelData();
         string dx = "", dy = "", dz = "";
         if (tabSpawnerX.Value == 0) dx = "~"; else dx = tabSpawnerX.Value.ToString();
         if (tabSpawnerY.Value == 0) dy = "~"; else dy = tabSpawnerY.Value.ToString();
         if (tabSpawnerZ.Value == 0) dz = "~"; else dz = tabSpawnerZ.Value.ToString();
         firstText = "";
         if (mcVersion == "1.8") { firstText = "/setblock " + dx + " " + dy + " " + dz + " minecraft:mob_spawner 0 replace {BlockEntityTag:{id:\"MobSpawner\",EntityId:" + asd.getAt(tabSpawnerShowType.SelectedIndex) + ",SpawnData:{"; }
         else { firstText = "/setblock " + dx + " " + dy + " " + dz + " minecraft:mob_spawner 0 replace {BlockEntityTag:{id:\"MobSpawner\",SpawnData:{id:" + asd.getAt(tabSpawnerShowType.SelectedIndex) + "\","; }
     }
     string secondText = "";
     if (tabSpawnerHasName.IsChecked.Value) secondText += "CustomName:\"" + tabSpawnerName.Text + "\",";
     if (globalSummonNBT != "") secondText += globalSummonNBT + ",";
     if (secondText.Length >= 1)
     {
         secondText = secondText.Remove(secondText.Length - 1, 1);
     }
     globalSpawnerData = secondText;
     secondText += "}";
     if (!tabSpawnerHasItemNL.IsChecked.Value)
     {
         AllSelData asd = new AllSelData();
         secondText += ",display:{Name:\"" + asd.getAtNameList(tabSpawnerShowType.SelectedIndex) + "\"}";
     }
     else
     {
         if (globalNLString != null && globalNLString != "")
         {
             secondText += "," + globalNLString;
         }
     }
     secondText += ",SpawnCount:" + tabSpawnerSpawnCount.Value + ",SpawnRange:" + tabSpawnerSpawnRange.Value + ",RequiredPlayerRange:" + tabSpawnerRequiredPlayerRange.Value + ",Delay:" + tabSpawnerDelay.Value + ",MinSpawnDelay:" + tabSpawnerMinSpawnDelay.Value + ",MaxSpawnDelay:" + tabSpawnerMaxSpawnDelay.Value + ",MaxNearbyEntities:" + tabSpawnerMaxNearbyEntities.Value;
     string thirdText = ",SpawnPotentials:[";
     if (tabSpawner1.IsChecked.Value)
     {
         if (mcVersion == "1.8")
         {
             AllSelData asd = new AllSelData();
             thirdText += "{Type:\"" + asd.getAt(tabSpawner1Type.SelectedIndex) + "\",Weight:" + tabSpawner1Weight.Value + ",Properties:{" + edata1 + "}}";
             if (tabSpawner2.IsChecked.Value)
             {
                 thirdText += ",{Type:\"" + asd.getAt(tabSpawner2Type.SelectedIndex) + "\",Weight:" + tabSpawner1Weight.Value + ",Properties:{" + edata2 + "}}";
                 if (tabSpawner3.IsChecked.Value)
                 {
                     thirdText += ",{Type:\"" + asd.getAt(tabSpawner3Type.SelectedIndex) + "\",Weight:" + tabSpawner1Weight.Value + ",Properties:{" + edata3 + "}}";
                     if (tabSpawner4.IsChecked.Value)
                     {
                         thirdText += ",{Type:\"" + asd.getAt(tabSpawner4Type.SelectedIndex) + "\",Weight:" + tabSpawner1Weight.Value + ",Properties:{" + edata4 + "}}";
                     }
                 }
             }
         }
         else
         {
             AllSelData asd = new AllSelData();
             thirdText += "{Weight:" + tabSpawner1Weight.Value + ",Entity:{id:\"" + asd.getAt(tabSpawner1Type.SelectedIndex) + "\"," + edata1 + "}}";
             if (tabSpawner2.IsChecked.Value)
             {
                 thirdText += ",{Weight:" + tabSpawner1Weight.Value + ",Entity:{id:\"" + asd.getAt(tabSpawner2Type.SelectedIndex) + "\"," + edata2 + "}}";
                 if (tabSpawner3.IsChecked.Value)
                 {
                     thirdText += ",{Weight:" + tabSpawner1Weight.Value + ",Entity:{id:\"" + asd.getAt(tabSpawner3Type.SelectedIndex) + "\"," + edata3 + "}}";
                     if (tabSpawner4.IsChecked.Value)
                     {
                         thirdText += ",{Weight:" + tabSpawner1Weight.Value + ",Entity:{id:\"" + asd.getAt(tabSpawner4Type.SelectedIndex) + "\"," + edata4 + "}}";
                     }
                 }
             }
         }
     }
     thirdText += "]";
     string ridingText = "";
     if (mcVersion == "1.8")
     {
         ridingText = "Riding:{" + sumosRiding + "}";
     }
     else
     {
         string finalRidingString = "";
         string finalRidingBackend = "";
         for (int i = 0; i < tabSumosRidingV1.Maximum + 1; i++)
         {
             if (ridingList[i, 0] != "")
             {
                 finalRidingString += ",Passengers:[";
                 for (int b = 0; b < ridingIndex.Length; b++)
                 {
                     if (ridingList[i, b] != "")
                     {
                         finalRidingString += b + ":{" + ridingList[i, b];
                         if (b != ridingIndex[i] - 1)
                         {
                             finalRidingString += "},";
                         }
                         else
                         {
                             finalRidingBackend = "}]," + finalRidingBackend;
                         }
                     }
                 }
             }
         }
         ridingText = finalRidingString + finalRidingBackend;
     }
     ridingText += ",";
     if (ridingText != "" && ridingText != "Riding:{}")
     {
         spawnerFinalStr = firstText + ridingText + secondText + thirdText + "}}";
     }
     else
     {
         spawnerFinalStr = firstText + secondText + thirdText + "}}";
     }
     spawnerFinalStr = spawnerFinalStr.Replace(",,", ",");
 }
        private void tabSumosCreate_Click(object sender, RoutedEventArgs e)
        {
            AllSelData asd = new AllSelData();
            string sumosText = "ArmorItems:[";
            int equipCount = 0;
            if (mcVersion == "1.8")
            {
                sumosText = "Equipment:[";
                if (sumosEquipmentMainHandId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentMainHandId) + ",Count:" + sumosEquipmentMainHandCount + "b,Damage:" + sumosEquipmentMainHandDamage + "s,tag:{" + globalSumosHand + "}},"; }
                if (sumosEquipmentBootId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentBootId) + ",Count:" + sumosEquipmentBootCount + "b,Damage:" + sumosEquipmentBootDamage + "s,tag:{" + globalSumosBoot + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (sumosEquipmentLegId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentLegId) + ",Count:" + sumosEquipmentLegCount + "b,Damage:" + sumosEquipmentLegDamage + "s,tag:{" + globalSumosLeg + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (sumosEquipmentChestId != 0) { equipCount++; sumosText += "{id:" + asd.getItem(sumosEquipmentChestId) + ",Count:" + sumosEquipmentChestCount + "b,Damage:" + sumosEquipmentChestDamage + "s,tag:{" + globalSumosChest + "}},"; } else { equipCount++; sumosText += "{},"; }
                if (tabSumosHasHeadID.IsChecked.Value == false)
                {
                    if (sumosEquipmentHeadId != 0)
                    {
                        sumosText += "{id:" + asd.getItem(sumosEquipmentHeadId) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:" + sumosEquipmentHeadDamage + "s,tag:{" + globalSumosHead + "}},";
                        equipCount++;
                    }
                    else { equipCount++; sumosText += "{},"; }
                }
                else
                {
                    globalSumosTempSel = tabSumosHead.SelectedIndex;
                    sumosText += "{id:" + asd.getItem(tabSumosHead.SelectedIndex) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:3s,tag:" + tabSumosHeadID.Text + "},";
                    equipCount++;
                }
            }
            else
            {
                tabSumosEgg.IsEnabled = true;
                sumosText += "0:{"; if (sumosEquipmentBootId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentBootId) + ",Count:" + sumosEquipmentBootCount + "b,Damage:" + sumosEquipmentBootDamage + "s,tag:{" + globalSumosBoot + "}"; } sumosText += "},";
                sumosText += "1:{"; if (sumosEquipmentLegId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentLegId) + ",Count:" + sumosEquipmentLegCount + "b,Damage:" + sumosEquipmentLegDamage + "s,tag:{" + globalSumosLeg + "}"; } sumosText += "},";
                sumosText += "2:{"; if (sumosEquipmentChestId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentChestId) + ",Count:" + sumosEquipmentChestCount + "b,Damage:" + sumosEquipmentChestDamage + "s,tag:{" + globalSumosChest + "}"; } sumosText += "},";
                if (tabSumosHasHeadID.IsChecked.Value == false)
                {
                    if (sumosEquipmentHeadId != 0)
                    {
                        sumosText += "3:{id:" + asd.getItem(sumosEquipmentHeadId) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:" + sumosEquipmentHeadDamage + "s,tag:{" + globalSumosHead + "}},";
                        equipCount++;
                    }
                }
                else
                {
                    globalSumosTempSel = tabSumosHead.SelectedIndex;
                    sumosText += "3:{id:" + asd.getItem(tabSumosHead.SelectedIndex) + ",Count:" + sumosEquipmentHeadCount + "b,Damage:3s,tag:" + tabSumosHeadID.Text + "},";
                    equipCount++;
                }
            }
            if (equipCount != 0)
            {
                sumosText = sumosText.Substring(0, sumosText.Length - 1);
                equipCount = 0;
            }
            sumosText += "],";
            sumosText = sumosText.Replace("Equipment:[{},{},{},{}],", "");
            sumosText = sumosText.Replace("Equipment:[0:{},1:{},2:{},3:{}],", "");
            if (mcVersion != "1.8")
            {
                sumosText += "HandItems:[";
                sumosText += "0:{"; if (sumosEquipmentMainHandId != 0) { equipCount++; sumosText += "id:" + asd.getItem(sumosEquipmentMainHandId) + ",Count:" + sumosEquipmentMainHandCount + "b,Damage:" + sumosEquipmentMainHandDamage + "s,tag:{" + globalSumosHand + "}"; } sumosText += "},";
                if (sumosEquipmentOffHandId != 0) { equipCount++; sumosText += "1:{id:" + asd.getItem(sumosEquipmentOffHandId) + ",Count:" + sumosEquipmentOffHandCount + "b,Damage:" + sumosEquipmentOffHandDamage + "s,tag:{" + globalSumosLHand + "}},"; }
                if (equipCount != 0)
                {
                    sumosText = sumosText.Substring(0, sumosText.Length - 1);
                    equipCount = 0;
                }
                sumosText += "],";
                sumosText = sumosText.Replace("ArmorItems:[0:{},1:{},2:{},]", "");
                sumosText = sumosText.Replace(",HandItems:[0:{},]", "");
                sumosText = sumosText.Replace("HandItems:[0:{},]", "");
            }
            if (tabSumosLeftHand.IsChecked.Value) sumosText += "LeftHanded:1b,";
            if (tabSumosDropchance.IsChecked.Value)
            {
                if (mcVersion == "1.8")
                {
                    sumosText += "DropChances:[" + tabSumosDCHand.Value + "F," + tabSumosDCBoot.Value + "F," + tabSumosDCLeg.Value + "F," + tabSumosDCChest.Value + "F," + tabSumosDCHead.Value + "F],";
                }
                else
                {
                    sumosText += "ArmorDropChances:[0:" + tabSumosDCBoot.Value + "F,1:" + tabSumosDCLeg.Value + "F,2:" + tabSumosDCChest.Value + "F,3:" + tabSumosDCHead.Value + "F],";
                    sumosText += "HandDropChances:[0:" + tabSumosDCHand.Value + "F,1:" + tabSumosDCLHand.Value + "F],";
                }
            }
            if (sumosText.Length != 0)
            {
                globalSumosEquipment = sumosText.Substring(0, sumosText.Length - 1).Replace(",tag:{}", "");
            }
            else
            {
                globalSumosEquipment = "";
            }
            sumosText = sumosText.Replace("{,", "{");
            if (tabSumosHasMetaData.IsChecked.Value)
            {
                sumosText += "Attributes:[" + globalAttrStringLess + "],";
            }
            if (tabSumosHasPotion.IsChecked.Value && asd.getAt(tabSumosType.SelectedIndex) != "TippedArrow" && asd.getAt(tabSumosType.SelectedIndex) != "ThrownPotion")
            {
                sumosText += "ActiveEffects:[" + globalPotionString + "],";
            }
            if (tabSumosInvulnerable.IsChecked.Value)
            {
                sumosText += "Invulnerable:1b,";
            }
            if (tabSumosHasName.IsChecked.Value)
            {
                sumosText += "CustomName:\"" + tabSumosName.Text + "\",";
                if (tabSumosNameVisible.IsChecked != null) { if (!tabSumosNameVisible.IsChecked.Value) sumosText += "CustomNameVisible:0,"; else sumosText += "CustomNameVisible:1,"; }
            }
            if (tabSumosNowHealthCheck.IsChecked.Value)
            {
                if (mcVersion == "1.8")
                {
                    sumosText += "HealF:" + tabSumosNowHealth.Value.Value + ",";
                }
                else
                {
                    sumosText += "Health:" + tabSumosNowHealth.Value.Value + "f,";
                }
            }
            if (tabSumosBaby.IsChecked.Value)
            {
                //盔甲架则为Small:1b,村民和可以自然长大的生物则Age:-2147483648,僵尸和猪人等则为IsBaby:1b
                sumosText += "IsBaby:1b,Age:-2147483648,IsBaby:1b,";
            }
            if (tabSumosSilent.IsChecked.Value)
            {
                sumosText += "Silent:1b,";
            }
            if (tabSumosNoAI.IsChecked.Value)
            {
                sumosText += "NoAI:1b,";
            }
            if (tabSumosFireCheck.IsChecked.Value)
            {
                sumosText += "Fire:" + tabSumosFireNum.Value + "s,";
            }
            if (tabSumosGlowing.IsChecked.Value)
            {
                sumosText += "Glowing:1b,";
            }
            if (tabSumosElytra.IsChecked.Value)
            {
                sumosText += "FallFlying:1b,";
            }
            if (tabSumosPersistenceRequired.IsChecked.Value)
            {
                sumosText += "PersistenceRequired:1b,";
            }
            if (tabSumosTeamCheck.IsChecked.Value)
            {
                sumosText += "Team:\"" + tabSumosTeam.Text + "\",";
            }
            if (mcVersion != "1.8")
            {
                if (tabSumosArmorNogravity.IsChecked.Value)
                {
                    sumosText += "NoGravity:1b,";
                }
            }
            if (tabSumosTagsCheck.IsChecked.Value)
            {
                string[] temp = tabSumosTags.Text.Replace("\r", "").Split('\n');
                sumosText += "Tags:[";
                for (int i = 0; i < temp.Length; i++)
                {
                    sumosText += "\"" + temp[i] + "\",";
                }
                sumosText = sumosText.Substring(0, sumosText.Length - 1);
                sumosText += "],";
            }
            if (tabSumosMotionCheck.IsChecked.Value)
            {
                int bx = tabSumosMotionX.Value.ToString().IndexOf('.');
                int by = tabSumosMotionY.Value.ToString().IndexOf('.');
                int bz = tabSumosMotionZ.Value.ToString().IndexOf('.');
                sumosText = sumosText + "Motion:[";
                if (bx == -1) sumosText += tabSumosMotionX.Value + ".0,"; else sumosText += tabSumosMotionX.Value + ",";
                if (by == -1) sumosText += tabSumosMotionY.Value + ".0,"; else sumosText += tabSumosMotionY.Value + ",";
                if (bz == -1) sumosText += tabSumosMotionZ.Value + ".0"; else sumosText += tabSumosMotionZ.Value;
                sumosText += "],";
            }
            if (tabSumosDirection.IsChecked.Value)
            {
                int bx = tabSumosDirectionX.Value.ToString().IndexOf('.');
                int by = tabSumosDirectionY.Value.ToString().IndexOf('.');
                sumosText = sumosText + "Rotation:[";
                if (by == -1) sumosText += tabSumosDirectionY.Value + ".0f,"; else sumosText += tabSumosDirectionY.Value + "f,";
                if (bx == -1) sumosText += tabSumosDirectionX.Value + ".0f,"; else sumosText += tabSumosDirectionX.Value + "f";
                sumosText += "],";
            }
            if (sumosText != null && sumosText != "") sumosText = sumosText.Substring(0, sumosText.Length - 1);
            sumosRidingSelType = asd.getAt(tabSumosType.SelectedIndex);
            //sumosRidingNBT = sumosText;
            globalSumosTypeIndex = tabSumosType.SelectedIndex;
            if (asd.getAt(tabSumosType.SelectedIndex) == "Villager" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager")//选择村民
            {
                if (tabVillagerMaxIndex >= globalVillagerMaxValue)
                {
                    tabVillagerMaxIndex = globalVillagerMaxValue - 1;
                }
                string summonVillager = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {Profession:" + asd.getVillagerCareerID(tabVillagerType.SelectedIndex).GetLength(0) + ",Career:" + asd.getVillagerCareerID(tabVillagerType.SelectedIndex).GetLength(1) + ",CareerLevel:9999999";
                summonVillager += "," + sumosText;//可能出现双重逗号
                summonVillager += ",Offers:{Recipes:[";
                string villagerOffers = "";
                string villagerReward = "";
                if (tabVillagerCheckCanCreate == true)
                {
                    if (tabVillagerRewardExp.IsChecked.Value)
                    {
                        villagerReward = ",rewardExp:" + tabVillagerRewardExpValue.Value + "b";
                    }
                    for (int i = 0; i <= tabVillagerMaxIndex; i++)
                    {
                        villagerOffers += "{maxUses:" + globalVillagerMaxUses[i] + villagerReward + ",buy:{id:" + asd.getItem(globalVillagerA[i]) + ",Count:" + globalVillagerACount[i] + "b,Damage:" + globalVillagerAMeta[i] + "s,tag:{" + globalVillagerAStr[i] + "}}";
                        if (globalVillagerBCheck[i] == true) villagerOffers += ",buyB:{id:" + asd.getItem(globalVillagerB[i]) + ",Count:" + globalVillagerBCount[i] + "b,Damage:" + globalVillagerBMeta[i] + "s,tag:{" + globalVillagerBStr[i] + "}}";
                        villagerOffers += ",sell:{id:" + asd.getItem(globalVillagerC[i]) + ",Count:" + globalVillagerCCount[i] + "b,Damage:" + globalVillagerCMeta[i] + "s,tag:{" + globalVillagerCStr[i] + "}}},";
                    }
                    if (villagerOffers.Length >= 1)
                    {
                        villagerOffers = villagerOffers.Remove(villagerOffers.Length - 1, 1);
                    }
                    summonVillager += villagerOffers;
                }
                else
                {
                    this.ShowMessageAsync("", SummonVAtLeastOnce, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel });
                }
                summonVillager += "]}}";
                summonVillager = summonVillager.Replace(",tag:{}", "").Replace(",,", ",");//fix double comma
                if (mcVersion == "1.8")
                {
                    summonVillager = summonVillager.Replace("splash_potion", "potion").Replace("lingering_potion", "potion");
                }
                sumosFinalStr = summonVillager;
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ArmorStand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:armor_stand")//盔甲架
            {
                string amtemp = "";
                if (tabSumosArmorCheck.IsChecked.Value)
                {
                    amtemp = "Pose:{Body:[" + tabSumosArmorBodyX.Value + "F," + tabSumosArmorBodyY.Value + "F," + tabSumosArmorBodyZ.Value + "F],"
                        + "LeftArm:[" + tabSumosArmorLArmX.Value + "F," + tabSumosArmorLArmY.Value + "F," + tabSumosArmorLArmZ.Value + "F],"
                        + "RightArm:[" + tabSumosArmorRArmX.Value + "F," + tabSumosArmorRArmY.Value + "F," + tabSumosArmorRArmZ.Value + "F],"
                        + "LeftLeg:[" + tabSumosArmorLLegX.Value + "F," + tabSumosArmorLLegY.Value + "F," + tabSumosArmorLLegZ.Value + "F],"
                        + "RightLeg:[" + tabSumosArmorRLegX.Value + "F," + tabSumosArmorRLegY.Value + "F," + tabSumosArmorRLegZ.Value + "F],"
                        + "Head:[" + tabSumosArmorHeadX.Value + "F," + tabSumosArmorHeadY.Value + "F," + tabSumosArmorHeadZ.Value + "F]},";
                }
                if (tabSumosArmorRotationCheck.IsChecked.Value)
                {
                    amtemp += "Rotation:[" + tabSumosArmorRotationX.Value + "F," + tabSumosArmorRotationY.Value + "F," + tabSumosArmorRotationZ.Value + "F],";
                }
                if (tabSumosArmorNochestplate.IsChecked.Value)
                {
                    amtemp += "NoBasePlate:1b,";
                }
                if (mcVersion == "1.8")
                {
                    if (tabSumosArmorNogravity.IsChecked.Value)
                    {
                        amtemp += "NoGravity:1b,";
                    }
                }
                if (tabSumosArmorCant.IsChecked.Value)
                {
                    amtemp += "DisabledSlots:2039583,";
                }
                if (tabSumosArmorShowarmor.IsChecked.Value)
                {
                    amtemp += "ShowArms:1b,";
                }
                if (tabSumosMarker.IsChecked.Value)
                {
                    amtemp += "Marker:1b,Invisible:1b,";
                }
                if (amtemp.Length > 1) { amtemp = amtemp.Substring(0, amtemp.Length - 1); }
                if (sumosText.Length > 0) { sumosText += "," + amtemp; } else { sumosText = amtemp; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ThrownPotion" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:potion")//选择扔出的药水瓶
            {
                if (tabSumosMotionCheck.IsChecked.Value)
                {
                    string tempPotion = "";
                    int xx = tabSumosMotionX.Value.ToString().IndexOf('.');
                    int yy = tabSumosMotionY.Value.ToString().IndexOf('.');
                    int zz = tabSumosMotionZ.Value.ToString().IndexOf('.');
                    string x = "", y = "", z = "";
                    if (xx == -1) x = tabSumosMotionX.Value.ToString() + ".0"; else x = tabSumosMotionX.Value.ToString();
                    if (yy == -1) y = tabSumosMotionY.Value.ToString() + ".0"; else x = tabSumosMotionY.Value.ToString();
                    if (zz == -1) z = tabSumosMotionZ.Value.ToString() + ".0"; else x = tabSumosMotionZ.Value.ToString();
                    if (globalSumosPotion.Length >= 2)
                    {
                        tempPotion = globalSumosPotion.Remove(globalSumosPotion.Length - 1, 1);
                        sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + tempPotion + ",Motion:[" + x + "," + y + "," + z + "]}";
                    }
                    else
                    {
                        sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + "{Motion:[" + x + "," + y + "," + z + "]}";
                    }

                }
                else
                {
                    sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ " + globalSumosPotion;
                }
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "AreaEffectCloud" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:area_effect_cloud")//选择滞留药水
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Effects:[" + globalPotionString + "],Duration:" + tabSumosEDuration.Value + ",Radius:" + tabSumosERadius.Value + "f,ParticleParam1:" + globalParticlePara1 + ",ParticleParam2:" + globalParticlePara2 + ",Color:" + globalParticleColor;
                if (globalParticleSel != 0) { sumosText += ",Particle:\"" + asd.getParticle(globalParticleSel) + "\""; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Chicken" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:chicken")
            {
                if (tabSumosBaby.IsChecked.Value) { if (sumosText.Length > 0) { sumosText += ",IsChickenJockey:1b"; } else { sumosText = "IsChickenJockey:1b"; } }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Enderman" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:enderman")
            {
                if (sumosEndermanCarried != -1)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",carried:\"" + asd.getItem(sumosEndermanCarried) + "\",carriedData:" + sumosEndermanCarriedMeta + "s";
                    }
                    else
                    {
                        sumosText = "carried:\"" + asd.getItem(sumosEndermanCarried) + "\",carriedData:" + sumosEndermanCarriedMeta + "s";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Ozelot" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ocelot")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",CatType:" + tabSumosECatType.Value.Value;
                }
                else
                {
                    sumosText = "CatType:" + tabSumosECatType.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Wolf" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wolf")
            {
                string temp = "";
                if (tabSumosEUUID.Text != null || tabSumosEUUID.Text != "") { if (mcVersion == "1.8") { temp = "Owner:" + tabSumosEUUID.Text; } else { temp = "OwnerUUID:" + tabSumosEUUID.Text; } }
                if (tabSumosEAngry.IsChecked.Value) { temp += ",Angry:1b"; }
                if (sumosText.Length > 0)
                {
                    sumosText += "," + temp;
                    if (tabSumosEWoolColor.SelectedIndex != -1) {sumosText += ",CollarColor:" + tabSumosEWoolColor.SelectedIndex; }
                }
                else
                {
                    sumosText += temp;
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText += ",CollarColor:" + tabSumosEWoolColor.SelectedIndex; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Sheep" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:sheep")
            {
                if (sumosText.Length > 0)
                {
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText += ",Color:" + tabSumosEWoolColor.SelectedIndex; }
                    if (tabSumosESheared.IsChecked.Value) { sumosText += ",Sheared:1b"; }
                }
                else
                {
                    if (tabSumosEWoolColor.SelectedIndex != -1) { sumosText = "Color:" + tabSumosEWoolColor.SelectedIndex; }
                    if (tabSumosESheared.IsChecked.Value) { sumosText += ",Sheared:1b"; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Creeper" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:creeper")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",ExplosionRadius:" + tabSumosEExplosionRadius.Value.Value + "b,Fuse:" + tabSumosEFuse.Value.Value + "s";
                    if (tabSumosEPowered.IsChecked.Value) { sumosText += ",powered:1b"; }
                }
                else
                {
                    sumosText = "ExplosionRadius:" + tabSumosEExplosionRadius.Value.Value + "b,Fuse:" + tabSumosEFuse.Value.Value + "s";
                    if (tabSumosEPowered.IsChecked.Value) { sumosText += ",powered:1b"; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Slime" || asd.getAt(tabSumosType.SelectedIndex) == "LavaSlime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:slime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:magma_cube")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Size:" + tabSumosESize.Value.Value;
                }
                else
                {
                    sumosText = "Size:" + tabSumosESize.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Shulker" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:shulker")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Peek:" + tabSumosEShulkerPeek.Value.Value + "b";
                }
                else
                {
                    sumosText = "Peek:" + tabSumosEShulkerPeek.Value.Value + "b";
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "EnderDragon" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_dragon")
            {
                if (tabSumosEDragon.Value.Value != -1)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",DragonPhase:" + tabSumosEDragon.Value.Value;
                    }
                    else
                    {
                        sumosText = "DragonPhase:" + tabSumosEDragon.Value.Value;
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Ghast" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ghast")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",ExplosionPower:" + tabSumosEExplosionPower.Value.Value;
                }
                else
                {
                    sumosText = "ExplosionPower:" + tabSumosEExplosionPower.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Rabbit" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:rabbit")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",RabbitType:" + tabSumosERabbitType.Value.Value;
                }
                else
                {
                    sumosText = "RabbitType:" + tabSumosERabbitType.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "WitherBoss" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wither")
            {
                if (sumosText.Length > 0)
                {
                    sumosText += ",Invul:" + tabSumosEInvul.Value.Value;
                }
                else
                {
                    sumosText = "Invul:" + tabSumosEInvul.Value.Value;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Endermite" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:endermite")
            {
                if (tabSumosEAtkByEnderman.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",PlayerSpawned:1b";
                    }
                    else
                    {
                        sumosText = "PlayerSpawned:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Zombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie")
            {
                if (tabSumosECanBreakDoor.IsChecked.Value) { sumosText += ",CanBreakDoors:1b"; }
                if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",ZombieType:" + tabSumosEZombieType.Value.Value; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "PigZombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_pigman")
            {
                if (tabSumosECanBreakDoor.IsChecked.Value) { sumosText += ",CanBreakDoors:1b"; }
                if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",ZombieType:" + tabSumosEZombieType.Value.Value; }
                if (tabSumosEAngry.IsChecked.Value) { sumosText += ",Anger:32767s"; }
                if (tabSumosEUUID.Text != "") { sumosText += ",HurtBy:" + tabSumosEUUID.Text; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "VillagerGolem" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager_golem")
            {
                if (tabSumosEPlayerCreated.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",PlayerCreated:1b";
                    }
                    else
                    {
                        sumosText = "PlayerCreated:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Pig" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:pig")
            {
                if (tabSumosESaddle.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",Saddle:1b";
                    }
                    else
                    {
                        sumosText = "Saddle:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Skeleton" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:skeleton")
            {
                if (sumosText.Length > 0)
                {
                    if (tabSumosEZombieType.Value.Value != -1) { sumosText += ",SkeletonType:" + tabSumosEZombieType.Value.Value; }
                }
                else
                {
                    if (tabSumosEZombieType.Value.Value != -1) { sumosText += "SkeletonType:" + tabSumosEZombieType.Value.Value; }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Guardian" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:guardian")
            {
                if (tabSumosEElder.IsChecked.Value)
                {
                    if (sumosText.Length > 0)
                    {
                        sumosText += ",Elder:1b";
                    }
                    else
                    {
                        sumosText = "Elder:1b";
                    }
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "EntityHorse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:horse")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                if (mcVersion != "latest") if (HorseTypeDonkey.IsChecked.Value) { sumosText += "Type:1"; } else if (HorseTypeMule.IsChecked.Value) { sumosText += "Type:2"; } else if (HorseTypeZombie.IsChecked.Value) { sumosText += "Type:3"; } else if (HorseTypeSkeleton.IsChecked.Value) { sumosText += "Type:4"; } else { sumosText += "Type:0"; }
                sumosText += ",Variant:" + HorseVariantValue.Value.Value;
                if (HorseTypeDonkey.IsChecked.Value || HorseTypeMule.IsChecked.Value) { sumosText += ",ChestedHorse:1b"; }
                if (HorseTamed.IsChecked.Value) { sumosText += ",Tame:1b"; if (HorseTamedUUID.Text != null || HorseTamedUUID.Text != "") { if (mcVersion == "1.8") { sumosText += ",OwnerName:" + HorseTamedUUID.Text; } else { sumosText += ",OwnerUUID:" + HorseTamedUUID.Text; } } }
                if (mcVersion != "latest") if (HorseSaddle.IsChecked.Value) { sumosText += ",Saddle:1b"; }
                if (HorseSkeletonTrap.IsChecked.Value) { sumosText += ",SkeletonTrap:1b,SkeletonTrapTime:" + HorseSkeletonTrapTime.Value.Value; }
                sumosText += ",Items:[";
                if (HorseChestList[0] != null && HorseChestList[0] != "") { sumosText += HorseChestList[0] + ","; }
                if (HorseChestList[1] != null && HorseChestList[1] != "") { sumosText += HorseChestList[1] + ","; }
                if (HorseChestList[2] != null && HorseChestList[2] != "") { sumosText += HorseChestList[2] + ","; }
                if (HorseChestList[3] != null && HorseChestList[3] != "") { sumosText += HorseChestList[3] + ","; }
                if (HorseChestList[4] != null && HorseChestList[4] != "") { sumosText += HorseChestList[4] + ","; }
                if (HorseChestList[5] != null && HorseChestList[5] != "") { sumosText += HorseChestList[5] + ","; }
                if (HorseChestList[6] != null && HorseChestList[6] != "") { sumosText += HorseChestList[6] + ","; }
                if (HorseChestList[7] != null && HorseChestList[7] != "") { sumosText += HorseChestList[7] + ","; }
                if (HorseChestList[8] != null && HorseChestList[8] != "") { sumosText += HorseChestList[8] + ","; }
                if (HorseChestList[9] != null && HorseChestList[9] != "") { sumosText += HorseChestList[9] + ","; }
                if (HorseChestList[10] != null && HorseChestList[10] != "") { sumosText += HorseChestList[10] + ","; }
                if (HorseChestList[11] != null && HorseChestList[11] != "") { sumosText += HorseChestList[11] + ","; }
                if (HorseChestList[12] != null && HorseChestList[12] != "") { sumosText += HorseChestList[12] + ","; }
                if (HorseChestList[13] != null && HorseChestList[13] != "") { sumosText += HorseChestList[13] + ","; }
                if (HorseChestList[14] != null && HorseChestList[14] != "") { sumosText += HorseChestList[14] + ","; }
                sumosText += "]";
                if (HorseChestList[15] != null && HorseChestList[15] != "") { sumosText += ",SaddleItem:" + HorseChestList[15] + ","; }
                if (HorseChestList[16] != null && HorseChestList[16] != "") { sumosText += ",ArmorItem:" + HorseChestList[16] + ","; }
                sumosText = sumosText.Replace(",,", ",");
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "TippedArrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:arrow")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                if (tabSumosHasPotion.IsChecked.Value)
                {
                    sumosText += "CustomPotionEffects:[" + globalPotionString + "]";
                }
                if (sumosText.Length > 0) { sumosText += ",pickup:" + tabSumosEpickup.Value.Value + "b"; } else { sumosText += "pickup:" + tabSumosEpickup.Value.Value + "b"; }
                if (sumosText.Length > 0) { sumosText += ",damage:" + tabSumosEdamage.Value.Value + "d"; } else { sumosText += "damage:" + tabSumosEdamage.Value.Value + "d"; }
                sumosFinalStr = "/summon Arrow ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "SpectralArrow" || asd.getAt(tabSumosType.SelectedIndex) == "Arrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:spectral_arrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:arrow")
            {
                if (sumosText.Length > 0) { sumosText += ",pickup:" + tabSumosEpickup.Value.Value + "b"; } else { sumosText += "pickup:" + tabSumosEpickup.Value.Value + "b"; }
                if (sumosText.Length > 0) { sumosText += ",damage:" + tabSumosEdamage.Value.Value + "d"; } else { sumosText += "damage:" + tabSumosEdamage.Value.Value + "d"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Fireball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:fireball")
            {
                if (sumosText.Length > 0) { sumosText += ",ExplosionPower:" + tabSumosEExplosionPower.Value.Value; } else { sumosText += "ExplosionPower:" + tabSumosEExplosionPower.Value.Value; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Snowball" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEgg" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEnderpearl" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownExpBottle" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:snowball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:egg" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_pearl" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_bottle")
            {
                if (tabSumosEUUID.Text != "")
                {
                    if (sumosText.Length > 0) { sumosText += ","; }
                    sumosText += "ownerName:" + tabSumosEUUID.Text;
                }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "Item" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item")
            {
                if (tabSummonItem.SelectedIndex == 0)
                {
                    summonFinalStr = SummonSNotChooseItemType;
                }
                else
                {
                    string summonText = "";
                    if (tabSummonPickupdelayCheck.IsChecked.Value)
                    {
                        summonText += "PickupDelay:" + tabSummonPickupdelay.Value + ",";
                    }
                    if (tabSummonAgeCheck.IsChecked.Value)
                    {
                        summonText += "Age:" + tabSummonAge.Value + ",";
                    }
                    summonText += "Item:{id:\"" + asd.getItem(tabSummonItem.SelectedIndex) + "\",Count:" + tabSummonCount.Value + "b,Damage:" + tabSummonMeta.Value + "s";
                    summonText += ",tag:{";
                    if (tabSummonHide.SelectedIndex != 0)
                    {
                        summonText += "HideFlags: " + tabSummonHide.SelectedIndex + ",";
                    }
                    if (tabSummonUnbreaking.IsChecked.Value)
                    {
                        summonText += "Unbreakable:1,";
                    }
                    if (tabSummonHasEnchant.IsChecked.Value || tabSummonHasNL.IsChecked.Value || tabSummonHasAttr.IsChecked.Value)
                    {
                        string meta = tabSummonGetBackMeta();
                        summonText += meta + ",";
                    }
                    summonText += "}}";
                    summonText = summonText.Replace(",tag:{,}", "");
                    if (tabSumosEOwner.Text != "") { summonText += ",Owner:" + tabSumosEOwner.Text; }
                    if (tabSumosEThrower.Text != "") { summonText += ",Thrower:" + tabSumosEThrower.Text; }
                    //ridingText = ",Riding:{id:\"" + asd.getItem(tabSummonItem.SelectedIndex) + "\",Count:" + tabSummonCount.Value + "b,Damage:" + tabSummonMeta.Value + "s";
                    sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + summonText + "}";
                }
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "XPOrb" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_orb")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Value:" + tabSumosEExp.Value.Value + "s";
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "PrimedTnt" || asd.getAt(tabSumosType.SelectedIndex) == "MinecartTNT" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:tnt_minecart")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                sumosText += "Fuse:" + tabSumosEFuse.Value.Value;
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "FallingSand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:falling_block")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                string sands = "";
                if (asd.getItem(FallingSandItemSel.SelectedIndex) != "minecraft:sand") sands += "Block:\"" + asd.getItem(FallingSandItemSel.SelectedIndex) + "\",";
                if (FallingSandMeta.Value.Value != 0) sands += "Data:" + FallingSandMeta.Value.Value + "s,";
                sands += "Time:" + FallingSandLifeTime.Value.Value + ",";
                if (!FallingSandIsDrop.IsChecked.Value) sands += "DropItem:0b,";
                if (FallingSandIsDamage.IsChecked.Value) { sands += "HurtEntities:1b,FallHurtMax:" + FallingSandMaxDamage.Value.Value + ",FallHurtAmount:" + FallingSandDamageCount.Value.Value + "f,"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + sands.Substring(0, sands.Length - 1) + "}";
            }
            else if (asd.getAt(tabSumosType.SelectedIndex) == "ItemFrame" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item_frame")
            {
                if (sumosText.Length > 0) { sumosText += ","; }
                string frame = "ItemDropChance:" + FrameDropChance.Value.Value + "f,ItemRotation:" + FrameRouteCount.Value.Value + "b,";
                if (FrameCoCheck.IsChecked.Value) { frame += "TileX:" + FrameX.Value.Value + ",TileY:" + FrameY.Value.Value + ",TileZ:" + FrameZ.Value.Value + ","; }
                if (FrameFacing.Value.Value != -1) { frame += "Facing:" + FrameFacing.Value.Value + "b,"; }
                if (FrameHasItem.IsChecked.Value) { frame += "Item:{Count:" + globalFrameItem[0] + "b,Damage:" + globalFrameItem[1] + "s,id:\"" + globalFrameItem[2] + "\",tag:{" + globalFrameItem[3] + "}},"; } else { frame += "Item:{},"; }
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + frame.Substring(0, frame.Length - 1) + "}";
            }
            else
            {
                sumosFinalStr = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {" + sumosText + "}";
            }
            sumosFinalStr = sumosFinalStr.Replace(",tag:{}", "").Replace("{,", "{").Replace(" {}", "");
            if (sumosFinalStr.IndexOf("{") == -1)
            {
                sumosRidingNBT = sumosText;
            }
            else
            {
                sumosRidingNBT = sumosFinalStr.Substring(sumosFinalStr.IndexOf("{") + 1, sumosFinalStr.Length - sumosFinalStr.IndexOf("{") - 2);
            }
            //我也不知道为什么要写这么复杂
            //判断是否含有颜色代码
            if (sumosFinalStr.IndexOf("§") != -1)
            {
                FixColorCode fcc = new FixColorCode();
                fcc.setStr(sumosFinalStr);
                fcc.ShowDialog();
                sumosFinalStr = fcc.getStr();
            }
        }
 private void tabSumosType_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     allVisInit();
     AllSelData asd = new AllSelData();
     if (asd.getAt(tabSumosType.SelectedIndex) == "Villager" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager")
     {
         SummonVHeader.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "ArmorStand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:armor_stand")
     {
         SummonArmorStandHeader.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Item" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item")
     {
         SummonSHeader.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Enderman" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:enderman")
     {
         tabSumosEEnderman.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Ozelot" || asd.getAt(tabSumosType.SelectedIndex) == "Wolf" || asd.getAt(tabSumosType.SelectedIndex) == "EntityHorse" || asd.getAt(tabSumosType.SelectedIndex) == "PigZombie" || asd.getAt(tabSumosType.SelectedIndex) == "Snowball" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEgg" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownEnderpearl" || asd.getAt(tabSumosType.SelectedIndex) == "ThrownExpBottle" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ocelot" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wolf" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:skeleton_horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:mule" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:donkey" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_pigman" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:snowball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:egg" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_pearl" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_bottle")
     {
         tabSumosEUUID.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Wolf" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wolf")
     {
         tabSumosEWoolColor.IsEnabled = true;
         tabSumosEWoolColor.Items.Clear();
         for (int i = 0; i < asd.getBannerColorCount(); i++)
         {
             tabSumosEWoolColor.Items.Add(asd.getBannerColorStr(i));
         }
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Creeper" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:creeper")
     {
         tabSumosEExplosionRadius.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "EnderDragon" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ender_dragon")
     {
         tabSumosEDragon.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Slime" || asd.getAt(tabSumosType.SelectedIndex) == "LavaSlime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:slime" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:magma_cube")
     {
         tabSumosESize.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Shulker" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:shulker")
     {
         tabSumosEShulkerPeek.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Creeper" || asd.getAt(tabSumosType.SelectedIndex) == "PrimedTnt" || asd.getAt(tabSumosType.SelectedIndex) == "MinecartTNT" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:creeper" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:tnt" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:tnt_minecart")
     {
         tabSumosEFuse.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Ghast" || asd.getAt(tabSumosType.SelectedIndex) == "Fireball" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ghast" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:fireball")
     {
         tabSumosEExplosionPower.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Ozelot" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:ocelot")
     {
         tabSumosECatType.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Rabbit" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:rabbit")
     {
         tabSumosERabbitType.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "WitherBoss" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wither")
     {
         tabSumosEInvul.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Creeper" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:creeper")
     {
         tabSumosEPowered.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Endermite" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:endermite")
     {
         tabSumosEAtkByEnderman.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Zombie" || asd.getAt(tabSumosType.SelectedIndex) == "PigZombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:husk" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_villager" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_pigman")
     {
         tabSumosECanBreakDoor.IsEnabled = true;
         SummonVHeader.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Zombie")
     {
         tabSumosEZombieType.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Sheep" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:sheep")
     {
         tabSumosEWoolColor.IsEnabled = true;
         tabSumosESheared.IsEnabled = true;
         tabSumosEWoolColor.Items.Clear();
         for (int i = 0; i < asd.getWoolColorCount(); i++)
         {
             tabSumosEWoolColor.Items.Add(asd.getWoolColor(i));
         }
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "VillagerGolem" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:villager_golem")
     {
         tabSumosEPlayerCreated.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Guardian")
     {
         tabSumosEElder.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Pig" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:pig")
     {
         tabSumosESaddle.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Skeleton")
     {
         tabSumosEZombieType.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "PigZombie" || asd.getAt(tabSumosType.SelectedIndex) == "Wolf" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_pigman" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:wolf")
     {
         tabSumosEAngry.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Arrow" || asd.getAt(tabSumosType.SelectedIndex) == "TippedArrow" || asd.getAt(tabSumosType.SelectedIndex) == "SpectralArrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:arrow" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:spectral_arrow")
     {
         tabSumosEpickup.IsEnabled = true;
         tabSumosEdamage.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "EntityHorse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:zombie_horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:skeleton_horse" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:mule" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:donkey")
     {
         SummonHorseHeader.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "Item" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item")
     {
         tabSumosEOwner.IsEnabled = true;
         tabSumosEThrower.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "XPOrb" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:xp_orb")
     {
         tabSumosEExp.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "AreaEffectCloud" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:area_effect_cloud")
     {
         tabSumosEDuration.IsEnabled = true;
         tabSumosERadius.IsEnabled = true;
         tabSumosEParticle.IsEnabled = true;
         tabSumosEParticleColor.IsEnabled = true;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "FallingSand" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:falling_block")
     {
         SummonSand.Visibility = Visibility.Visible;
     }
     if (asd.getAt(tabSumosType.SelectedIndex) == "ItemFrame" || asd.getAt(tabSumosType.SelectedIndex) == "minecraft:item_frame")
     {
         SummonFrame.Visibility = Visibility.Visible;
     }
 }
 private void tabSumosEgg_Click(object sender, RoutedEventArgs e)
 {
     AllSelData asd = new AllSelData();
     if (sumosFinalStr.IndexOf('{') != -1)
     {
         string temp = sumosFinalStr.Substring(sumosFinalStr.IndexOf('{') + 1, sumosFinalStr.Length - sumosFinalStr.IndexOf('{') - 2);
         sumosFinalStr = "/give @p minecraft:spawn_egg 1 0 {EntityTag:{id:\"" + asd.getAt(tabSumosType.SelectedIndex) + "\"," + temp + "}}";
     }
     else
     {
         sumosFinalStr = "/give @p minecraft:spawn_egg 1 0 {EntityTag:{id:\"" + asd.getAt(tabSumosType.SelectedIndex) + "\"}}";
     }
     Check cbox = new Check();
     cbox.showText(sumosFinalStr);
     cbox.Show();
 }
 private void tabSumosRiding_Click(object sender, RoutedEventArgs e)
 {
     if (mcVersion == "1.8")
     {
         AllSelData asd = new AllSelData();
         string finaltext = "/summon " + asd.getAt(tabSumosType.SelectedIndex) + " ~ ~1 ~ {Riding:{";
         if (sumosRidingNBT != "")
         {
             sumosRiding = "id:" + sumosRidingSelType + "," + sumosRidingNBT + ",Riding:{" + sumosRiding + "}";
         }
         else
         {
             sumosRiding = "id:" + sumosRidingSelType + ",Riding:{" + sumosRiding + "}";
         }
         sumosFinalStr = finaltext + sumosRiding + "}}";
     }
     else
     {
         if (sumosRidingNBT != "") sumosRiding = "id:" + sumosRidingSelType + "," + sumosRidingNBT; else sumosRiding = "id:" + sumosRidingSelType;
         ridingList[(int)tabSumosRidingV1.Value.Value, ridingIndex[(int)tabSumosRidingV1.Value.Value]] = sumosRiding;
         ridingIndex[(int)tabSumosRidingV1.Value.Value]++;
     }
 }
 private void createBtn_Click(object sender, RoutedEventArgs e)
 {
     AllSelData asd = new AllSelData();
     if (rbTellraw.IsChecked.Value || rbTitle.IsChecked.Value || rbSubtitle.IsChecked.Value || rbActionbar.IsChecked.Value)
     {
         if (rbTellraw.IsChecked.Value) { finalStr = "/tellraw @a "; }
         if (rbTitle.IsChecked.Value) { finalStr = "/title @a title "; }
         if (rbSubtitle.IsChecked.Value) { finalStr = "/title @a subtitle "; }
         if (rbActionbar.IsChecked.Value) { finalStr = "/title @a actionbar "; }
         finalStr += "{\"text\":\"\",\"extra\":[";
         for (int i = 0; i < text.Count(); i++)
         {
             string finalStr2 = "{";
             if (type[i] == 2) { finalStr2 += "\"selector\":\"" + text[i] + "\","; } else if (type[i] == 3) { finalStr2 += "\"score\":{\"name\":\"" + text[i] + "\",\"objective\":\"" + text2[i] + "\"},"; } else { finalStr2 += "\"text\":\"" + text[i] + "\","; }
             if (color[i] != -1) { finalStr2 += "\"color\":\"" + asd.getColor(color[i]) + "\","; }
             if (isBold[i]) { finalStr2 += "\"bold\":true,"; }
             if (isItalic[i]) { finalStr2 += "\"italic\":true,"; }
             if (isUnderline[i]) { finalStr2 += "\"underlined\":true,"; }
             if (isStrikethorugh[i]) { finalStr2 += "\"strikethrough\":true,"; }
             if (isObfuscate[i]) { finalStr2 += "\"obfuscated\":true,"; }
             if (isInsertion[i]) { finalStr2 += "\"insertion\":\"" + insertion[i] + "\","; }
             if (ceCheck[i] != 0)
             {
                 finalStr2 += "\"clickEvent\":{";
                 if (ceCheck[i] == 1) { finalStr2 += "\"action\":\"run_command\",\"value\":\"" + runcmd[i] + "\""; }
                 if (ceCheck[i] == 2) { finalStr2 += "\"action\":\"suggest_command\",\"value\":\"" + suggest[i] + "\""; }
                 if (ceCheck[i] == 3) { finalStr2 += "\"action\":\"open_url\",\"value\":\"" + openurl[i] + "\""; }
                 if (ceCheck[i] == 4) { finalStr2 += "\"action\":\"change_page\",\"value\":\"" + bookpage[i] + "\""; }
                 finalStr2 += "},";
             }
             if (heCheck[i] != 0)
             {
                 finalStr2 += "\"hoverEvent\":{";
                 if (isShowtextCode[i])
                 {
                     if (heCheck[i] == 1) { finalStr2 += "\"action\":\"show_text\",\"value\":" + showtext[i]; }
                 }
                 else
                 {
                     if (heCheck[i] == 1) { finalStr2 += "\"action\":\"show_text\",\"value\":\"" + showtext[i] + "\""; }
                 }
                 if (heCheck[i] == 2) { finalStr2 += "\"action\":\"show_item\",\"value\":\"" + showitem[i] + "\""; }
                 if (heCheck[i] == 3) { finalStr2 += "\"action\":\"show_entity\",\"value\":\"{\\\"name\\\":\\\"" + showentityname[i] + "\\\",\\\"type\\\":\\\"" + asd.getAt(showentitytype[i]) + "\\\",\\\"id\\\":\\\"" + showentityuuid[i] + "\\\"}\""; }
                 if (heCheck[i] == 4) { finalStr2 += "\"action\":\"show_achievement\",\"value\":\"" + showachevement[i] + "\""; }
                 finalStr2 += "},";
             }
             finalStr2 = finalStr2.Substring(0, finalStr2.Length - 1);
             finalStr2 += "},";
             finalStr += finalStr2;
         }
         if (finalStr.Substring(finalStr.Length - 1, 1) == ",") { finalStr = finalStr.Substring(0, finalStr.Length - 1); }
         finalStr += "]}";
     }
     else if (rbBook.IsChecked.Value)
     {
         finalStr = "/give @p minecraft:written_book 1 0 ";
         finalStr += "{title:\"" + tBookTitle.Text + "\",author:\"" + tBookAuthor.Text + "\",pages:[";
         int maxPage = 1;
         for (int i = 0; i < pagenum.Count(); i++)
         {
             if (pagenum[i] > maxPage)
             {
                 maxPage = pagenum[i];
             }
         }
         for (int j = 0; j < maxPage; j++)//分页
         {
             finalStr += "\"{\\\"text\\\":\\\"\\\",\\\"extra\\\":[";
             for (int i = 0; i < text.Count(); i++)
             {
                 if (pagenum[i] == j + 1)
                 {
                     string finalStr2 = "{";
                     if (type[i] == 2) { finalStr2 += "\\\"selector\\\":\\\"" + text[i] + "\\\","; } else if (type[i] == 3) { finalStr2 += "\\\"score\\\":{\\\"name\\\":\\\"" + text[i] + "\\\",\\\"objective\\\":\\\"" + text2[i] + "\\\"},"; } else { finalStr2 += "\\\"text\\\":\\\"" + text[i] + "\\\","; }
                     if (color[i] != -1) { finalStr2 += "\\\"color\\\":\\\"" + asd.getColor(color[i]) + "\\\","; }
                     if (isBold[i]) { finalStr2 += "\\\"bold\\\":true,"; }
                     if (isItalic[i]) { finalStr2 += "\\\"italic\\\":true,"; }
                     if (isUnderline[i]) { finalStr2 += "\\\"underlined\\\":true,"; }
                     if (isStrikethorugh[i]) { finalStr2 += "\\\"strikethrough\\\":true,"; }
                     if (isObfuscate[i]) { finalStr2 += "\\\"obfuscated\\\":true,"; }
                     if (isInsertion[i]) { finalStr2 += "\\\"insertion\\\":\\\"" + insertion[i] + "\\\","; }
                     if (ceCheck[i] != 0)
                     {
                         finalStr2 += "\\\"clickEvent\\\":{";
                         if (ceCheck[i] == 1) { finalStr2 += "\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"" + runcmd[i] + "\\\""; }
                         if (ceCheck[i] == 2) { finalStr2 += "\\\"action\\\":\\\"suggest_command\\\",\\\"value\\\":\\\"" + suggest[i] + "\\\""; }
                         if (ceCheck[i] == 3) { finalStr2 += "\\\"action\\\":\\\"open_url\\\",\\\"value\\\":\\\"" + openurl[i] + "\\\""; }
                         if (ceCheck[i] == 4) { finalStr2 += "\\\"action\\\":\\\"change_page\\\",\\\"value\\\":\\\"" + bookpage[i] + "\\\""; }
                         finalStr2 += "},";
                     }
                     if (heCheck[i] != 0)
                     {
                         finalStr2 += "\\\"hoverEvent\\\":{";
                         if (isShowtextCode[i])
                         {
                             if (heCheck[i] == 1) { finalStr2 += "\\\"action\\\":\\\"show_text\\\",\\\"value\\\":" + showtext[i]; }
                         }
                         else
                         {
                             if (heCheck[i] == 1) { finalStr2 += "\\\"action\\\":\\\"show_text\\\",\\\"value\\\":\\\"" + showtext[i] + "\\\""; }
                         }
                         if (heCheck[i] == 2) { finalStr2 += "\\\"action\\\":\\\"show_item\\\",\\\"value\\\":\\\"" + showitem[i] + "\\\""; }
                         if (heCheck[i] == 3) { finalStr2 += "\\\"action\\\":\\\"show_entity\\\",\\\"value\\\":\\\"{\\\\\\\"name\\\\\\\":\\\\\\\"" + showentityname[i] + "\\\\\\\",\\\\\\\"type\\\\\\\":\\\\\\\"" + asd.getAt(showentitytype[i]) + "\\\\\\\",\\\\\\\"id\\\\\\\":\\\\\\\"" + showentityuuid[i] + "\\\\\\\"}\\\""; }
                         if (heCheck[i] == 4) { finalStr2 += "\\\"action\\\":\\\"show_achievement\\\",\\\"value\":\\\"" + showachevement[i] + "\""; }
                         finalStr2 += "},";
                     }
                     finalStr2 = finalStr2.Substring(0, finalStr2.Length - 1);
                     finalStr2 += "},";
                     //finalStr2 = finalStr2.Replace("\\\"", "\\\\\\\"");
                     finalStr += finalStr2;
                 }
             }
             if (finalStr.Substring(finalStr.Length - 1, 1) == ",") { finalStr = finalStr.Substring(0, finalStr.Length - 1); }
             finalStr += "]}\",";
         }
         if (finalStr.Substring(finalStr.Length - 1, 1) == ",") { finalStr = finalStr.Substring(0, finalStr.Length - 1); }
         finalStr += "]}";
     }
     else if(rbSign.IsChecked.Value)
     {
         finalStr = "/setblock ~ ~1 ~ minecraft:standing_sign 0 replace {";
         for (int j = 1; j <= 4; j++)
         {
             string ceStr = "", heStr = "";
             finalStr += "Text" + j + ":\"{\\\"text\\\":\\\"\\\",\\\"extra\\\":[";
             for (int i = 0; i < text.Count(); i++)
             {
                 if (pagenum[i] == j)
                 {
                     string finalStr2 = "{";
                     if (type[i] == 2) { finalStr2 += "\"selector\":\"" + text[i] + "\","; } else if (type[i] == 3) { finalStr2 += "\"score\":{\"name\":\"" + text[i] + "\",\"objective\":\"" + text2[i] + "\"},"; } else { finalStr2 += "\"text\":\"" + text[i] + "\","; }
                     if (color[i] != -1) { finalStr2 += "\"color\":\"" + asd.getColor(color[i]) + "\","; }
                     if (isBold[i]) { finalStr2 += "\"bold\":true,"; }
                     if (isItalic[i]) { finalStr2 += "\"italic\":true,"; }
                     if (isUnderline[i]) { finalStr2 += "\"underlined\":true,"; }
                     if (isStrikethorugh[i]) { finalStr2 += "\"strikethrough\":true,"; }
                     if (isObfuscate[i]) { finalStr2 += "\"obfuscated\":true,"; }
                     if (isInsertion[i]) { finalStr2 += "\"insertion\":\"" + insertion[i] + "\","; }
                     if (ceCheck[i] != 0)
                     {
                         string finalStr3 = "\"clickEvent\":{";
                         if (ceCheck[i] == 1) { finalStr3 += "\"action\":\"run_command\",\"value\":\"" + runcmd[i] + "\""; }
                         if (ceCheck[i] == 2) { finalStr3 += "\"action\":\"suggest_command\",\"value\":\"" + suggest[i] + "\""; }
                         if (ceCheck[i] == 3) { finalStr3 += "\"action\":\"open_url\",\"value\":\"" + openurl[i] + "\""; }
                         if (ceCheck[i] == 4) { finalStr3 += "\"action\":\"change_page\",\"value\":\"" + bookpage[i] + "\""; }
                         finalStr3 += "}";
                         if (finalStr3 != "\"clickEvent\":{}") { ceStr = finalStr3; }
                     }
                     finalStr2 = finalStr2.Substring(0, finalStr2.Length - 1);
                     finalStr2 += "},";
                     finalStr2 = finalStr2.Replace("\\\"", "\\\\\\\"").Replace("\"", "\\\"");
                     finalStr += finalStr2;
                 }
             }
             if (finalStr.Substring(finalStr.Length - 1, 1) == ",") { finalStr = finalStr.Substring(0, finalStr.Length - 1); }
             finalStr += "]";
             if (ceStr != "") { ceStr=ceStr.Replace("\\\"", "\\\\\\\"").Replace("\"", "\\\""); finalStr += "," + ceStr; }
             if (heStr != "") { heStr = heStr.Replace("\\\"", "\\\\\\\"").Replace("\"", "\\\""); finalStr += "," + heStr; }
             finalStr += "}\",";
         }
         if (finalStr.Substring(finalStr.Length - 1, 1) == ",") { finalStr = finalStr.Substring(0, finalStr.Length - 1); }
         finalStr += "}";
     }
     finalStr = finalStr.Replace(",\\\"clickEvent\\\":{}", "").Replace(",\\\"hoverEvent\\\":{}", "").Replace(",\"clickEvent\":{}", "").Replace(",\"hoverEvent\":{}", "").Replace(",\\\"extra\\\":[]", "").Replace(",\"extra\":[]", "");
 }
 private void createBtn_Click(object sender, RoutedEventArgs e)
 {
     if (atP.IsChecked.Value)
     {
         createText = "@p";
     }
     else if (atA.IsChecked.Value)
     {
         createText = "@a";
     }
     else if (atR.IsChecked.Value)
     {
         createText = "@r";
     }
     else if (atE.IsChecked.Value)
     {
         createText = "@e";
     }
     else
     {
         createText = "@p";
     }
     string extra = "";
     if (xyzCheck.IsChecked.Value)
     {
         extra += "x=" + x.Value.ToString() + ",y=" + y.Value.ToString() + ",z=" + z.Value.ToString() + ",";
     }
     if (dxCheck.IsChecked.Value)
     {
         extra += "dx=" + dx.Value.ToString() + ",";
         extra += "dy=" + dy.Value.ToString() + ",";
         extra += "dz=" + dz.Value.ToString() + ",";
     }
     if (rCheck.IsChecked.Value)
     {
         extra += "r=" + r.Value.ToString() + ",";
     }
     if (rmCheck.IsChecked.Value)
     {
         extra += "rm=" + rm.Value.ToString() + ",";
     }
     if (mCheck.IsChecked.Value)
     {
         if (mUN.IsChecked.Value)
         {
             extra += "m=!" + m.Value.ToString() + ",";
         }
         else
         {
             extra += "m=" + m.Value.ToString() + ",";
         }
     }
     if (rxCheck.IsChecked.Value)
     {
         extra += "rx=" + rx.Value.ToString() + ",";
     }
     if (rxmCheck.IsChecked.Value)
     {
         extra += "rxm=" + rxm.Value.ToString() + ",";
     }
     if (cCheck.IsChecked.Value)
     {
         extra += "c=" + c.Value.ToString() + ",";
     }
     if (ryCheck.IsChecked.Value)
     {
         extra += "ry=" + ry.Value.ToString() + ",";
     }
     if (rymCheck.IsChecked.Value)
     {
         extra += "rym=" + rym.Value.ToString() + ",";
     }
     if (lCheck.IsChecked.Value)
     {
         extra += "l=" + l.Value.ToString() + ",";
     }
     if (lmCheck.IsChecked.Value)
     {
         extra += "lm=" + lm.Value.ToString() + ",";
     }
     if (scoreCheck.IsChecked.Value)
     {
         extra += "score_" + scoreName.Text + "=" + score.Value.ToString() + ",";
     }
     if (scoreMinCheck.IsChecked.Value)
     {
         extra += "score_" + scoreMinName.Text + "_min=" + scoreMin.Value.ToString() + ",";
     }
     if (teamCheck.IsChecked.Value)
     {
         if (teamUN.IsChecked.Value)
         {
             extra += "team=!" + team.Text + ",";
         }
         else
         {
             extra += "team=" + team.Text + ",";
         }
     }
     if (nameCheck.IsChecked.Value)
     {
         if (nameUN.IsChecked.Value)
         {
             extra += "name=!" + name.Text + ",";
         }
         else
         {
             extra += "name=" + name.Text + ",";
         }
     }
     if (typeCheck.IsChecked.Value)
     {
         AllSelData asd = new AllSelData();
         if (typeUN.IsChecked.Value)
         {
             extra += "type=!" + asd.getAt(type.SelectedIndex) + ",";
         }
         else
         {
             extra += "type=" + asd.getAt(type.SelectedIndex) + ",";
         }
     }
     if (tagCheck.IsChecked.Value)
     {
         extra += "tag=" + tags.Text + ",";
     }
     if (extra.Length != 0)
     {
         extra = extra.Remove(extra.Length - 1, 1);
         createText += "[" + extra + "]";
     }
     string nbt = "";
     if (flyCheck.IsChecked.Value)
     {
         nbt += "abilities:{flying:1b},";
     }
     if (handCheck.IsChecked.Value)
     {
         AllSelData asd = new AllSelData();
         string temp = "";
         string temp2 = "";
         if (handMeta.Value != -1)
         {
             temp = ",Damage:" + handMeta.Value + "s";
         }
         if (getItemText.Text != "")
         {
             temp2 = ",tag:{" + getItemText.Text + "}";
         }
         nbt += "SelectedItem:{id:" + asd.getItem(hand.SelectedIndex) + ",Count:" + handCount.Value + "b" + temp + temp2 + "},";
     }
     if (itemCheck.IsChecked.Value && cmd != "")
     {
         nbt += cmd + ",";
     }
     if (rideCheck.IsChecked.Value)
     {
         AllSelData asd = new AllSelData();
         nbt += "RootVehicle:{Entity:{id:\"" + asd.getAt(rideEntity.SelectedIndex) + "\"}},";
     }
     if (nbt.Length != 0)
     {
         nbt = nbt.Remove(nbt.Length - 1, 1);
         nbt = "{" + nbt + "}";
         createText += " " + nbt;
     }
 }