Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Recommended Posts

Please, please please please for the love of god learn basic java.

Some of your classes don't even compile (duplicate methods, etc.), you don't follow any kind of coding convention (class names are in UpperCamelCase, fields and methods in lowerCamelCase, etc.), your code formatting is a mess.

It is a pain in the butt to help you, because your code is unreadable.

 

Other than that: coolboy is right (this happens if you just copy&paste code without understanding anything).

 

(To note, because I get shouted at for posts like this a lot: This is not an insult against you. I am just telling you the facts, don't get upset.)

Link to post
Share on other sites

I'm not offended but, I'm trying to learn to understand it by doing this which is something I enjoy.

 

You should not learn Java by modding Minecraft. You will only learn things common in Minecraft, but if there's a problem, you don't know what to do (best example is this thread).

I suggest read some basic Java tutorials and make a standalone program yourself first before attempt to mod Minecraft.

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to post
Share on other sites

I'm not offended but, I'm trying to learn to understand it by doing this which is something I enjoy.

 

You should not learn Java by modding Minecraft. You will only learn things common in Minecraft, but if there's a problem, you don't know what to do (best example is this thread).

I suggest read some basic Java tutorials and make a standalone program yourself first before attempt to mod Minecraft.

 

I disagree, I learned java from modding minecraft. But you absolutely NEED to do so by reading general java tutorials when you get stuck instead of coming to the forums and asking for help. You also need to observe and try to mimic the conventions of minecrafts code. Lastly, before asking for help on the forums, make sure the your error is with minecraft, and not java. If you ever have problems with Java, either when just modding, or when someone suggest that you do something and you have no idea what they are talking about, use google. If you are ever come across something in minecrafts code that you don't understand due to it being more advanced java than what you know, google it. If you are ever curious about some java thing you see in mincerafts code, google it. If you are ever bored and want to know something more about some java thing, google it. In this case though, your problem is that as cool boy said, EntityPlayer does not extend EntityLiving. (it does extend EntityLivingBase though)

Link to post
Share on other sites
I disagree, I learned java from modding minecraft.
If you have programming experience in other languages that's totally fine.
But you absolutely NEED to do so by reading general java tutorials when you get stuck instead of coming to the forums and asking for help.
Not only reading them. Follow them and try to make simple standalone java programs outside of Minecraft first.
You also need to observe and try to mimic the conventions of minecrafts code.
No. Just no. Minecraft code is a lot of things, but not a good example for code.

 

Learning Java by Modding only is not a good idea, even if you follow (java) tutorials. That is because in Minecraft all the "low level" stuff is already done for you. Modding is programming on quite a high level of abstraction already. Starting with that is like putting the cart before the horse.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • For some reason my Minecraft server is not letting me take any type of damage, and not only that, but I've configured the server to make normally crashing entities to dissapear instead, to try and look at what the error might be. For some reason, Entities will become corrupted when trying to hurt me. Here I give you the crash report: java.lang.NoSuchMethodError: net.minecraft.entity.player.InventoryPlayer.func_70440_f(I)Lnet/minecraft/item/ItemStack;     at com.lying.variousoddities.utility.bus.VOBusServer.onPlayerBreakArmorEventPre(VOBusServer.java:878)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_728_VOBusServer_onPlayerBreakArmorEventPre_LivingHurtEvent.invoke(.dynamic)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)     at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:604)     at net.minecraft.entity.player.EntityPlayer.func_70665_d(EntityPlayer.java:1120)     at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.java:926)     at net.minecraft.entity.player.EntityPlayer.func_70097_a(EntityPlayer.java:1038)     at net.minecraft.entity.player.EntityPlayerMP.func_70097_a(EntityPlayerMP.java:645)     at micdoodle8.mods.galacticraft.core.entities.player.GCEntityPlayerMP.func_70097_a(GCEntityPlayerMP.java:68)     at drzhark.mocreatures.entity.MoCEntityAnimal.func_70652_k(MoCEntityAnimal.java:1123)     at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70652_k(MoCEntitySnake.java:460)     at net.minecraft.entity.ai.EntityAIAttackMelee.func_190102_a(EntityAIAttackMelee.java:178)     at net.minecraft.entity.ai.EntityAIAttackMelee.func_75246_d(EntityAIAttackMelee.java:167)     at net.minecraft.entity.ai.EntityAITasks.func_75774_a(SourceFile:129)     at net.minecraft.entity.EntityLiving.func_70626_be(EntityLiving.java:763)     at net.minecraft.entity.EntityLivingBase.func_70636_d(EntityLivingBase.java:2359)     at net.minecraft.entity.EntityLiving.func_70636_d(EntityLiving.java:577)     at net.minecraft.entity.EntityAgeable.func_70636_d(EntityAgeable.java:178)     at net.minecraft.entity.passive.EntityAnimal.func_70636_d(SourceFile:43)     at drzhark.mocreatures.entity.MoCEntityAnimal.func_70636_d(MoCEntityAnimal.java:359)     at drzhark.mocreatures.entity.MoCEntityTameableAnimal.func_70636_d(MoCEntityTameableAnimal.java:435)     at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70636_d(MoCEntitySnake.java:415)     at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179)     at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)     at drzhark.mocreatures.entity.passive.MoCEntitySnake.func_70071_h_(MoCEntitySnake.java:265)     at net.minecraft.world.World.func_72866_a(World.java:1996)     at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:832)     at net.minecraft.world.World.func_72870_g(World.java:1958)     at net.minecraft.world.World.func_72939_s(World.java:1762)     at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)     at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Unknown Source) I can also link the whole log if this doesn't help. Thank you.
    • Hello! I want to make a 'sky block'. I just want to render the sky in it. How can I do that ? Here is a screenshot Thanks in advance !
    • Now the problem has been solved. Thank you. I mistook (!world.isClientSide) in the vanilla MinecartItem class for (world.isClientSide).
    • You cannot reliably do this. What you can do is try to find out by looking through ModList#getModFiles and check where the class came from. But this is unreliable, which is why for example @EventBusSubscriber requires you to specify the ModID.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.