How to code a selective nuker

Posts 15 of 5 · Page 1 of 1
How to code a selective nuker
Welcome to my first tutorial!

I am not going to give you the variables! (skids must learn!)

So for the first peice of code you want to go to 'EntityClientPlayerMP' and paste this code inside:
Code:
        int var5000 = (int)mc.playerController.getBlockReachDistance();
        if(yourvarclass.yourvarmod)
        {
        	for(int x = -var5000; x < var5000 + 1; x++)
        	{
        		for(int z = -var5000; z < var5000 + 1; z++)
        		{
        			for(int y = -var5000; y < var5000 + 1; y++)
        			{
        				int e = (int) posX + x;
        				int f = (int) posY + y;
        				int g = (int) posZ + z;
        				if(mc.theWorld.getBlockId(e, f, g) == mods.blockID)
        				{
        					this.sendQueue.addToSendQueue(new Packet14BlockDig(0, e, f, g, 0));
        					this.sendQueue.addToSendQueue(new Packet14BlockDig(2, e, f, g, 0));
        				}
        			}
        		}
        	}
        }
And for the second part you want to go into 'PlayerControllerMP' and find 'public void clickBlock' (press CTRL+F and then just paste that in)
Then call that from the top of the void:
Code:
        if(yourvarclass.yourvarmod)
        {
        	yourvarclass.blockID = mc.theWorld.getBlockId(par1, par2, par3);
        }
Hint: the yourvarclass.blockID is an integer.
I don't think skids will get anything out of this. Also, this isn't how I would have done it, but it's close enough.
Also some point's I'd like to mention:

1. Why are you putting this EntityClientPlayerMP? Why not put it in it's own class for the sake or organization?
2. Why not call the nuker void itself from clickBlock using the constructor and have it be a click nuker?
1. I have a click nuker. That's it.
Nice tutorial i guess (i dont know how to code)
Interesting. Nice tut.
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?