Hey, I finally understand most of this tutorial, however near the end of #5 I am getting errors that I don't know how to fix. the setBlockName and setBlockTextureName are coming up as errors, as well as IIconRegister and itemIcon. it's saying there's nothing to import, and I don't know what to do from here. Help?
I understand that, how much would that affect it though? Like 1.5-1.6 I could see having major differences, and I'm pretty sure 1.7 had a new forge overhaul or something, but I'm quite sure coding strategies would be the same between 1.7.10 and 1.8. I could be wrong, though.
Hey, what's goin' on? The event.drops.add() doesn't work, 'cause drops can't be resolved. Okay, okay, okay. I changed the BreakEvent to HarvestDropsEvent, but frankly, I don't think it works fine, 'cause this event is used another case (for example leaves, that can be breaking by hand). But I tried, there is no syntax error, hurray! Well:
Ah, but when I break the Stone block in the game, it drops a Cobblestone, not Broken Stone (which defined by me). I tried with hand punch, but it doesn't work again. I will try open up certain avenues... I don't know what's wrong.
I understand that, how much would that affect it though? Like 1.5-1.6 I could see having major differences, and I'm pretty sure 1.7 had a new forge overhaul or something, but I'm quite sure coding strategies would be the same between 1.7.10 and 1.8. I could be wrong, though.
There is an entire new rebreeding system for blocks and such. There is typically always a huge overhaul when it comes to large Minecraft updates, and you can know that when forge takes a long time to get into a stable version. Your going to have differences between 1.7 and 1.8 code; it's just how it is.
Hey, what's goin' on? The event.drops.add() doesn't work, 'cause drops can't be resolved. Okay, okay, okay. I changed the BreakEvent to HarvestDropsEvent, but frankly, I don't think it works fine, 'cause this event is used another case (for example leaves, that can be breaking by hand). But I tried, there is no syntax error, hurray! Well:
Ah, but when I break the Stone block in the game, it drops a Cobblestone, not Broken Stone (which defined by me). I tried with hand punch, but it doesn't work again. I will try open up certain avenues... I don't know what's wrong.
Make sure you are getting your event fired using the right bus (I think Harvest is just the event bus), and calling it in one of you init methods. If you are still having errors, I'll see if I can get it working.
Yep! Well, doesn't work. I use the MinecraftForge.EVENT_BUS.register(this); code in PreInit event, nothing. I use this code in Init event, nothing. I use this code in addBlockDrops() event, but it still doesn't. I put this code into my class of defined block (BrokenStoneBlock.java), in case... but nothing. BlockEvent, SubscribeEvent etc. are imported, so I don't understand and frustrated.
Yep! Well, doesn't work. I use the MinecraftForge.EVENT_BUS.register(this); code in PreInit event, nothing. I use this code in Init event, nothing. I use this code in addBlockDrops() event, but it still doesn't. I put this code into my class of defined block (BrokenStoneBlock.java), in case... but nothing. BlockEvent, SubscribeEvent etc. are imported, so I don't understand and frustrated.
I believe there is a mistake in the armour with potion effects tutorial: you are testing if armour item 0 is boots, 1 is leggings etc to add potion effects, however in the armour tutorial, you say 0 is helmet, 1 is chestplate etc.
Which is right?
EDIT: tested code, and works properly the way it is in the tutorial.
How come when adding armour, the numbers are the opposite way round to when testing for wearing it?
I believe there is a mistake in the armour with potion effects tutorial: you are testing if armour item 0 is boots, 1 is leggings etc to add potion effects, however in the armour tutorial, you say 0 is helmet, 1 is chestplate etc.
Which is right?
EDIT: tested code, and works properly the way it is in the tutorial.
How come when adding armour, the numbers are the opposite way round to when testing for wearing it?
Who knows. There is probably a logical reasoning behind it however.
I think my post had a bug or was removed... I'm quite lazy and I don't want to rewrite everything, So, sorry if I look like I'm rude! (I thank you for your tutorial, even if I'm stuck at the beggining of it!)
I'm not english native speaker, so I might say things not really understandable, sorry! I'm a big noob, so feel free to answer me like I'm an idiot so I can understand what you want to tell me!
In the first part of your tutorial, you said:
"Next, we are going to head on over to GitHub to create our repo. If you haven’t already, go ahead and make an account on GitHub. Next to your name on the top will be a + sign. Click that, and then create a new repository. Name the repository whatever your mod name is. On the right hand side, look for a box that says “HTTPS Clone URL”. Copy that link, and open up Terminal or Command Prompt."
Ok, I could do that! But then...
"In there, type “cd “, then drag the folder that says “1.7” or whichever you put there and press “enter”. Then type “git clone {paste the github link your copied here}”. This should create a folder in the “1.7” folder and contain a few files. If you get to this, great job! You’ve setup your GitHub repo."
You were talking about the Windows Command Prompt, right? It's not possible to drag a folder in there =/ and typing "cd" won't do anything... so, what did you mean? Can I have a screenshot, please? D=
I thank you in advance for helping me!
I use a Mac, so in Terminal, "cd" means change directory. I believe Command Prompt is the same thing, but I never use Windows, so I'm not 100% sure.
Are you absolutely 100% sure? I spent 5 minutes staring at the screen thinking the same thing, and I had written "baconArmour_layer_1" instead of "baconArmour_layer1"
It's very easy to miss subtle errors in the path one specifies.
One thing I noticed is that when you add files to the mod manually, eclipse doesn't notice them immediately. Have you tried refreshing your project files in the project explorer? This sometimes fixes textures etc not being found. Just right click on the project and hit refresh.
This is what it says in the console (With both layers)
[17:48:38] [Client thread/WARN]: Failed to load texture: revotech:models/armor/copper_layer_2.png
java.io.FileNotFoundException: revotech:models/armor/copper_layer_2.png
at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?]
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[SimpleReloadableResourceManager.class:?]
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[SimpleTexture.class:?]
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?]
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?]
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:60) [Render.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]
at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:283) [RenderManager.class:?]
at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(GuiInventory.java:112) [GuiInventory.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:839) [GuiContainerCreative.class:?]
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:93) [GuiContainer.class:?]
at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) [InventoryEffectRenderer.class:?]
at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) [GuiContainerCreative.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
and hit enter it says that "git" is not a recognized as in internal or external command, operable program or batch file. sorry if this is something im only stuck on but could you please help?
Hey, I just started reading this tutorial and it's super helpful! I've never coded before but always wanted to. Only problem: I can't even get everything set up. I get to this point:
"Next, we are going to head on over to GitHub to create our repo. If you haven’t already, go ahead and make an account on GitHub. Next to your name on the top will be a + sign. Click that, and then create a new repository. Name the repository whatever your mod name is. On the right hand side, look for a box that says “HTTPS Clone URL”. Copy that link, and open up Terminal or Command Prompt. In there, type “cd “, then drag the folder that says “1.7” or whichever you put there and press “enter”. Then type “git clone {paste the github link your copied here}”. This should create a folder in the “1.7” folder and contain a few files. If you get to this, great job! You’ve setup your GitHub repo."
It took a while to find the URL to copy. But I can't find the Command Prompt. Maybe the website changed it's layout or something? I actually downloaded GitHub and tried it that way, which didn't work either. Or maybe I'm just bad at english. Help please *cry*
@jeramiah -- Install git. If you are on a Mac, it is as simple as downloading the Developer Tools. If you use Windows, you'll have to manually install it.
@PinkPheonix101 -- Command Prompt is your terminal window on your OS to give you access to the command line. Should've been pretty self-explanatory, but I guess not.
These tutorials are for 1.7.10, not 1.8.
Oooh, thanks for helping out, but I don't understand how to use BlockEvent, 'cause I tried number of ways in main class. So, here are some attempts:
@SubscribeEvent
public void addStoneDrops(BlockEvent.BreakEvent event)
{
if(event.block == Blocks.stone)
{
event.drops.add(new ItemStack(MyMinecraftMod.blockBrokenStoneBlock));
}
}
Hey, what's goin' on? The event.drops.add() doesn't work, 'cause drops can't be resolved. Okay, okay, okay. I changed the BreakEvent to HarvestDropsEvent, but frankly, I don't think it works fine, 'cause this event is used another case (for example leaves, that can be breaking by hand). But I tried, there is no syntax error, hurray! Well:
@SubscribeEvent
public void addStoneDrops(BlockEvent.HarvestDropsEvent event)
{
if(event.block == Blocks.stone)
{
event.drops.add(new ItemStack(MyMinecraftMod.blockBrokenStoneBlock));
}
}
Ah, but when I break the Stone block in the game, it drops a Cobblestone, not Broken Stone (which defined by me). I tried with hand punch, but it doesn't work again. I will try open up certain avenues... I don't know what's wrong.
There is an entire new rebreeding system for blocks and such. There is typically always a huge overhaul when it comes to large Minecraft updates, and you can know that when forge takes a long time to get into a stable version. Your going to have differences between 1.7 and 1.8 code; it's just how it is.
Make sure you are getting your event fired using the right bus (I think Harvest is just the event bus), and calling it in one of you init methods. If you are still having errors, I'll see if I can get it working.
Yep! Well, doesn't work.
Edit:
You won't believe me, SOLVED!
@SubscribeEvent
public void addBlockDrops(BlockEvent.HarvestDropsEvent event)
{
if(event.block == Blocks.stone)
{
event.drops.clear();
event.drops.add(new ItemStack(Item.getItemFromBlock(MyMinecraftMod.blockBrokenStoneBlock), 1));
}
}
Google :P?
This tutorial is for 1.7, not 1.8. Some 1.7 code will not work for 1.8.
everything is imported
public class ItemEasySquidsShovel extends Items
{
public final ToolMaterial toolMaterial;
public ItemEasySquidsShovel(ToolMaterial EnumToolMaterial)
{
super(EnumToolMaterial);
toolMaterial = EnumToolMaterial;
setCreativeTab(ModTabs.tabEasySquids);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon(Reference.MODID + ":" + getUnlocalizedName()substring(5));
}
public static void init()
{
RegisterHelper.registerItem(squidiumShovel);
}
}
EDIT: The only error I have now is the squidiumShovel not resolving to a variable.
You've got several pretty bad problems going on. Re-read the tutorial and make sure you are putting certain blocks of code in the right places.
Hitboxes are controlled by #setSize. Call this in your entities constructor.
I believe there is a mistake in the armour with potion effects tutorial: you are testing if armour item 0 is boots, 1 is leggings etc to add potion effects, however in the armour tutorial, you say 0 is helmet, 1 is chestplate etc.Which is right?EDIT: tested code, and works properly the way it is in the tutorial.
How come when adding armour, the numbers are the opposite way round to when testing for wearing it?
Make sure the maps are located in the right place.
Who knows. There is probably a logical reasoning behind it however.
I use a Mac, so in Terminal, "cd" means change directory. I believe Command Prompt is the same thing, but I never use Windows, so I'm not 100% sure.
It's very easy to miss subtle errors in the path one specifies.
It's either a bad import (imported the wrong import), or your modid contains capital letters.
and hit enter it says that "git" is not a recognized as in internal or external command, operable program or batch file. sorry if this is something im only stuck on but could you please help?
https://twitter.com/The_Jeramiah
Follow me on twitter!
"Next, we are going to head on over to GitHub to create our repo. If you haven’t already, go ahead and make an account on GitHub. Next to your name on the top will be a + sign. Click that, and then create a new repository. Name the repository whatever your mod name is. On the right hand side, look for a box that says “HTTPS Clone URL”. Copy that link, and open up Terminal or Command Prompt. In there, type “cd “, then drag the folder that says “1.7” or whichever you put there and press “enter”. Then type “git clone {paste the github link your copied here}”. This should create a folder in the “1.7” folder and contain a few files. If you get to this, great job! You’ve setup your GitHub repo."
It took a while to find the URL to copy. But I can't find the Command Prompt. Maybe the website changed it's layout or something? I actually downloaded GitHub and tried it that way, which didn't work either. Or maybe I'm just bad at english. Help please *cry*
@PinkPheonix101 -- Command Prompt is your terminal window on your OS to give you access to the command line. Should've been pretty self-explanatory, but I guess not.