💡 How to properly mod minecraft

Posts 1–6 of 6 · Page 1 of 1
💡 How to properly mod minecraft
Hi everyone! I've been playing around with modding Minecraft for the past days and there's always been one thing that was bugging me the the highest point, I'm currently learning java in college and although I can code pretty well, we didn't learn how to work with more then one class yiet.

this is where my issue comes in to play, so far all my coding has been implemented in already existing classes, I know for a fact this is the wrong way to do it, and it has been bugging me ever since, but I don't know how to do it otherwise.

what I would like to be able to do is create classes with each of my hacks that don't modify already existing minecraft functions,

Ex: godmod doesn't need a class, ( We could but it would be very small )

now a class that I would really like to make is one for my aimbot because it shouldn't be sitting in GuiIngame.

so here's what I'm asking, how to properly make classes that interacts with the minecraft code.

here's my aimbot method that i would like to implement:
Code:
public static void aimbot(){
		
		for(int i = 0; i < mc.theWorld.loadedEntityList.size(); i++){
			Entity entity = (Entity) mc.theWorld.loadedEntityList.get(i);
			if(entity instanceof EntityLiving && entity != mc.thePlayer && !entity.isDead && mc.thePlayer.getDistanceSqToEntity(entity) <= 25 && mc.thePlayer.canEntityBeSeen(entity)){
				if(Mouse.isButtonDown(0)){
					mc.thePlayer.faceEntity(entity, 200F, 200F);
				}
				
			}
		}		
	}
also, special thx to Drinking Water for his aimbot code!!
Well take your method and put it in a class. Then modify one of the existing classes and add a call to your method in there somewhere.
Quote Originally Posted by Scyntrian View Post
Well take your method and put it in a class. Then modify one of the existing classes and add a call to your method in there somewhere.
yes I managed to get it to work last week, The thing that wasn't working properly for me was that I was using a different minecraft object in my class so I had to make the one in GuiIngame public, I know its not the best way but atleast now my code is a little bit cleaner!

anyways thank you for your response!
/moved to Minecraft Help
Would you rather have this in the Java coding section? Because many of us here do not actually know how to code, possible @Nico could help you with this. Look in the Minecraft hacks section, there might be some people who released their own clients that you could ask for help from.
I think it would be probably a better idea to move this thread to the java section because it's more related to codding in itself rather then minecraft.

Thank you to have taken the time to move this thread to a more appropriate section!
Create your own packages and create your hooks and things.Then make your class for your hack and do your calling and stuffs.
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us