Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

["For" Loop] KILLAURA CODE [HELP]

Hi all. I'm not a real Minecraft Hacked Client devolper but I'm learning (and skidding xD).

I found a code for a killaura.
Not working.
Fixed and now it works but only for 1 time, i need to press again every time the keybind (every f***ing time)

Here is the code
Code
    public void toggle(){
        if(!this.getState()){
            for(Object o : mc.theWorld.loadedEntityList){
                Entity e = (Entity)o;
                if(e != mc.thePlayer &&
                    mc.thePlayer.getDistanceToEntity(e) <= 4.5F &&
                    !e.isDead){
                        mc.thePlayer.setSprinting(false);
                        mc.thePlayer.swingItem();
                        mc.playerController.attackEntity(this.mc.thePlayer, e);
                }
            }
        }
    }

This should be a For loop but this doesn't work.

I tried with public void onUpdate() but doesn't work at all.

Help please!!
MC version is 1.8. MCP 910 (I'm not sure about the MCP version but probably is correct 910).

Thank you all for your time!!
Warning
I don't actually know if this is correct or not. Take it with a grain of salt. I just felt like leaving my own input though for the hell of it.

It will only work once per entity that is within area of the player because the for loop only loops as many times as there are entities rendered and it only will run code for each entity once before going to the next one. One way of achieving it to keep attacking would be changing the "if(!this.getState())" to "while(!this.getState())" assuming getState() returns if the module is enabled or not. But an issue would be that it would be running the code too fast/often. So you would have to incorporate a delay/timer so it only runs the code every so often.

Also my own question since I don't develop clients myself either, would he need to check the instance of the entity that he gets from the loadedEntitylist so he isn't attacking non living entities like armor stands and minecarts?
Hi, thank you for your reply!

[Also my own question since I don't develop clients myself either, would he need to check the instance of the entity that he gets from the loadedEntitylist so he isn't attacking non living entities like armor stands and minecarts?]
The module should check for player, mobs or animals (SHOULD).
I'm learning coding java so if I wrong something sorry me :C
and sorry for my ugly english but I'm italian :)


I will try to replace if(!this.getState()) with while(!this.getState())


Edit - If i put "while" the game crash. I need to add a delay. Any idea?
What is the error that it says when the game crashes? Also yeah you are probably going to need to put a delay. I guess that depending on how the isDead boolean is returned, that will get rid of all non living entities.
For future reference, This type of question might be better suited in the griefing section.
Edit - If i put "while" the game crash. I need to add a delay. Any idea?

Nope, the thing is that this will keep going even if you aren't in a world, so it will keep trying to do the loop in the main menu persay, which would mean that 'mc.thePlayer' doesn't even exist therefore causing a crash.

Too lazy to tell you the proper way to do it, I suggest watching some sort of tutorial or something.

Good Luck!
Thank you all :C I'm sad xD
Desquh idk wich is the error :C
You are looping through entities when you toggle your module, thats why everytime you toggle your module it attacks.
If you don't want to manually attack entities everytime, you need to call your method from another where else.
The most common place is under EntityPlayer#onUpdate. You can create an onUpdate method in your module class
and call from there, for example EntityPlayer#onUpdate{Client.modules.get(KillAura.class).onUpdate(); doMoreStuff();}
I hope it helps you
(Jul 23, 2017 09:59 PM)Wdestroier Wrote:  You are looping through entities when you toggle your module, thats why everytime you toggle your module it attacks.
If you don't want to manually attack entities everytime, you need to call your method from another where else.
The most common place is under EntityPlayer#onUpdate. You can create an onUpdate method in your module class
and call from there, for example EntityPlayer#onUpdate{Client.modules.get(KillAura.class).onUpdate(); doMoreStuff();}
I hope it helps you

I'm gonna make a tutorial on a basic client base eventually, newbies with shitty client bases, ughhh~
Thank you all :)
WDestroier I will try!!
Couple things. First of all, when is your toggle method being called? If its named correctly, then I would imagine it gets called when you enable the module, so the reason its only hitting once is because you only call the method once. You need to be calling this method constantly.

Also, if !this.getState() would lead me to believe that that expression is only true when the module is NOT on, but I can't know for sure without seeing the code.
do you have discord? i can hmu
this wont help in any way but heres my code for kill aura. for all those people who want to copy/paste :
sadly you wont learn anything form copy/pasting but fuck it im high af so il just post it...
and also this is a simple kill aura that puches at a normal speed regardless of the combat update and locks on to kneck/head area. (terrible and outdated but it works)
hopefully you guys will be able to build on this and make it a lot better.

Code
    int delay;

    private void killaura() {
        List list = mc.theWorld.playerEntities;
        delay++;

        for (int k = 0; k < list.size(); k++) {
            if (((EntityPlayer) list.get(k)).getName() == mc.thePlayer.getName()) {
                continue;
            }

            EntityPlayer entityplayer = (EntityPlayer) list.get(1);

            if (mc.thePlayer.getDistanceToEntity(entityplayer) > mc.thePlayer.getDistanceToEntity((Entity) list.get(k))) {
                entityplayer = (EntityPlayer) list.get(k);
            }

            float f = mc.thePlayer.getDistanceToEntity(entityplayer);

            if (f < 4F && mc.thePlayer.canEntityBeSeen(entityplayer) && delay > 7) {
                this.faceEntity(entityplayer);
                mc.playerController.attackEntity(mc.thePlayer, entityplayer);
                mc.thePlayer.swingItem();
                delay = 0;
                continue;
            }
        }
    }

    public static synchronized void faceEntity(EntityLivingBase entity) {
        final float[] rotations = getRotationsNeeded(entity);

        if (rotations != null) {
            mc.thePlayer.rotationYaw = rotations[0];
            mc.thePlayer.rotationPitch = rotations[1] + 1.0F;// 14
        }
    }

    public static float[] getRotationsNeeded(Entity entity) {
        if (entity == null) {
            return null;
        }

        final double diffX = entity.posX - mc.thePlayer.posX;
        final double diffZ = entity.posZ - mc.thePlayer.posZ;
        double diffY;

        if (entity instanceof EntityLivingBase) {
            final EntityLivingBase entityLivingBase = (EntityLivingBase) entity;
            diffY = entityLivingBase.posY + entityLivingBase.getEyeHeight() - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight());
        } else {
            diffY = (entity.boundingBox.minY + entity.boundingBox.maxY) / 2.0D - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight());
        }

        final double dist = MathHelper.sqrt_double(diffX * diffX + diffZ * diffZ);
        final float yaw = (float) (Math.atan2(diffZ, diffX) * 180.0D / Math.PI) - 90.0F;
        final float pitch = (float) -(Math.atan2(diffY, dist) * 180.0D / Math.PI);
        return new float[] { mc.thePlayer.rotationYaw + MathHelper.wrapAngleTo180_float(yaw - mc.thePlayer.rotationYaw), mc.thePlayer.rotationPitch + MathHelper.wrapAngleTo180_float(pitch - mc.thePlayer.rotationPitch) };
    }

if you are getting errors at mc.thePlayer(etc) replace "mc" with "Minecraft.getMinecraft()"
you can use the source of wurst to get all codes this work very good


Possibly Related Threads...
Thread / Author Replies Views Last Post
by EreiosfhSep 9, 2017 08:10 AM 6 222 Sep 9, 2017 08:10 AM
Last Post: Meave
by balalayka77Aug 25, 2017 07:46 AM 3 288 Aug 25, 2017 07:46 AM
Last Post: Top Shotta
by OnlyQubesDec 16, 2016 05:22 PM 0 1,407 Dec 16, 2016 05:22 PM
Last Post: OnlyQubes