so I am trying to make a loop in which I create a new instance of an object every time it loops: something like this.
Client client = new Client(session);
client.Connect(server);
while (true) {
client.SendPacket(new Craft.Net.CreativeInventoryActionPacket(-1, new Craft.Net.ItemStack((short)19, (sbyte)1)));
client.Disconnect ("Generic");
System.Threading.Thread.Sleep(3000);
//obviously I cannot do this, because there is already an object named client.
Client client = new Client(session);
client.Connect(server);
}
How would I go about doing this? I need to make a NEW instance of MinecraftClient, I cannot reuse the old one after I do client.Disconnect.