Can you show us how to make a mob fly? i wanna make my muffinsteve mod fly XD
You could do
if(onGround)
{
jump;
}
if(!onGround)
{
jump;
}
so if it wasn't on the ground it would jump and if it was on the ground it would still jump thus making it fly. One problem in doing this is that it would fly up forever.
This looks a heck a lot simpler than some other people try to explain it (so thanks!) but I'm still confused. I probably just need some more coding experience. Thanks for breaking it down though! I'll come back and try this in a while.
This looks a heck a lot simpler than some other people try to explain it (so thanks!) but I'm still confused. I probably just need some more coding experience. Thanks for breaking it down though! I'll come back and try this in a while.
thanks for the positive feedback and not just taking the code completely not understanding it. It helps if you have some coding experience to understand this stuff.
Hello great tutorial but im getting errors on GuiIngame.java it says next to Timer.timerSpeed that it cant make a static reference to Timer.timerSpeed and also im getting an error on EntityPlayerSp.java but its above all the fly code im getting the error on - protected boolean pushOutOfBlocks(double d, double d1, double d2) please help thank you
Hello great tutorial but im getting errors on GuiIngame.java it says next to Timer.timerSpeed that it cant make a static reference to Timer.timerSpeed and also im getting an error on EntityPlayerSp.java but its above all the fly code im getting the error on - protected boolean pushOutOfBlocks(double d, double d1, double d2) please help thank you
for the Timer.timerSpeed, just hover your mouse over the error and click on the "change modifier of 'timerSpeed' to 'static'". as for the entityplayersp part, i think you may have put it in the wrong spot or put a "}" in the wrong spot. just Check over these things and tell me if you still are getting errors.
Updating to Minecraft 1.0
im going to be updating this to minecraft 1.0 when mcp comes out. I tried making it a fast fly without the timer speed but it was anoying to only be able to move one direction at a time. When i figure this out, i will update it.
Depending on how this function is supposed to play out. You can't stick things in the middle because then it doesn't know wether to do it IF or ELSE. The first code is for both, the last code is for ELSE.
[20:16] OpenAL initialized.
[20:16]
[20:16] java.lang.NullPointerException
[20:16] at net.minecraft.src.EntityPlayerSP.pushOutOfBlocks(EntityPlayerSP.java:
465)
[20:16] at net.minecraft.src.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:1
83)
[20:16] at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:338)
[20:16] at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:211)
[20:16] at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:1661
)
[20:16] at net.minecraft.src.World.updateEntity(World.java:1637)
[20:16] at net.minecraft.src.World.updateEntities(World.java:1540)
[20:16] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1523)
[20:16] at net.minecraft.client.Minecraft.func_40001_x(Minecraft.java:686)
[20:16] at net.minecraft.client.Minecraft.run(Minecraft.java:627)
[20:16] at java.lang.Thread.run(Unknown Source)
[20:16] Stopping!
[20:16]
[20:16] SoundSystem shutting down...
[20:16] Author: Paul Lamb, www.paulscode.com
[20:16]
Press any key to continue . . .
i have another problem, i have seen this one before when i made a toggle sprint mod, infact it was caused by a similar line. everything has compiled correctly. but once i enter a world i get the above error after saving chunks. note. i have the importing the keyboard.
if(gameSettings.flyEnabled == true)
thats the line 465 which is giving the error, i have tryed it with and without the == true, it gives an error once entering the game.
}
if(byte0 == 5)
{
motionZ = f;
}
}
if(gameSettings.flyEnabled == true)
motionY = 0.0D; //disabled Y movement (falling)
Mods.flyfallfix = true; // this fixes fly fall in single player
if(Keyboard.isKeyDown(18) && mc.inGameHasFocus && gameSettings.flyEnabled == true) // key(18) is (E)
{
motionY += 0.2D;
}else
if(Keyboard.isKeyDown(16) && mc.inGameHasFocus && gameSettings.flyEnabled == true) //key(16) is (Q)
{
motionY -= 0.2D;
}
return false;
}
thats the code from that region
also if i was to change the
if(Keyboard.isKeyDown(18)
to something like
if(gameSettings.ascendflyKeyDown == true)
(if ascendfly was a gamesetting option) would that produce any errors, or is their a simpler method to doing this.
thanks for all the help, ive only been doing java a week now. :smile.gif:
You could do
so if it wasn't on the ground it would jump and if it was on the ground it would still jump thus making it fly. One problem in doing this is that it would fly up forever.
i might take a look if i find the time
fly fall fix in single player, it can be found in the no fall section.
thanks for the positive feedback and not just taking the code completely not understanding it. It helps if you have some coding experience to understand this stuff.
for the Timer.timerSpeed, just hover your mouse over the error and click on the "change modifier of 'timerSpeed' to 'static'". as for the entityplayersp part, i think you may have put it in the wrong spot or put a "}" in the wrong spot. just Check over these things and tell me if you still are getting errors.
Updating to Minecraft 1.0
im going to be updating this to minecraft 1.0 when mcp comes out. I tried making it a fast fly without the timer speed but it was anoying to only be able to move one direction at a time. When i figure this out, i will update it.
Did I "win the internet"?
Done =)
Update 4
Updated to 1.0.0
added more detail to part 1.
Part 2 now uses an array list to make everything look a lot nicer than before.
just getting that, im unsure how to fix it.
thats in the GuiIngame. i have stuck 100% to what you said to do.
You put the else statement in the wrong spot. put it like this.
Then put an extra bracket after the declaration of the arraylist.
Thank you ail_t for the awesome signature
i tryed it with and without the } after declaration.
Thank you ail_t for the awesome signature
or this:
Depending on how this function is supposed to play out. You can't stick things in the middle because then it doesn't know wether to do it IF or ELSE. The first code is for both, the last code is for ELSE.
Hackforums is the most low quality site in the world. Most people probably get the code from this.
Thank you ail_t for the awesome signature
isnt the idea to learn java, or learn how a flymod works?
if you just want a flymod, why not just get zombe's
i have another problem, i have seen this one before when i made a toggle sprint mod, infact it was caused by a similar line. everything has compiled correctly. but once i enter a world i get the above error after saving chunks. note. i have the importing the keyboard.
thats the line 465 which is giving the error, i have tryed it with and without the == true, it gives an error once entering the game.
thats the code from that region
also if i was to change the to something like (if ascendfly was a gamesetting option) would that produce any errors, or is their a simpler method to doing this.
thanks for all the help, ive only been doing java a week now. :smile.gif:
I didn't say the reason was because of that. I said I couldn't figure out where the code went, how about you read my WHOLE comment first.
the first page says where the code goes, how about you read the WHOLE tutorial first.