Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Minecraft ModLoader 1.5.1 Tutorial

minecraft modloader 1.5.1 tutorial

  • Please log in to reply
27 replies to this topic

#1

JanitorialMilk
  • Location: Planet X

Posted 25 March 2013 - 12:22 AM

Setting up your Java IDE:
Spoiler:
Your first mod:
Spoiler:
Your first Item:
Spoiler:
Adding textures to your Blocks and Items:
Spoiler:
Adding a simple crafting recipe:
Spoiler:
Adding a smelting (cooking) recipe:
Spoiler:
Adding a light value to a block:
Spoiler:
Adding a Shapeless Crafting Recipe:
Spoiler:

lalalalalalalalala :)

Register or log in to remove.

#2

TheCobblestone

Posted 25 March 2013 - 09:12 PM

Hey, the methode
.getIndirectPowerOutput();
dosen't exists...

#3

JanitorialMilk
  • Location: Planet X

Posted 25 March 2013 - 10:31 PM

View PostTheCobblestone, on 25 March 2013 - 09:12 PM, said:

Hey, the methode
.getIndirectPowerOutput();
dosen't exists...
It only works for blocks, i.e.
public static Block myBlock = new Block(190, Material.glass).getIndirectPowerOutput("myBlock");

lalalalalalalalala :)

#4

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 25 March 2013 - 10:54 PM

For some reason my Item doesn't show at all- any help?

#5

AliensShallRule
  • Location: USA
  • Minecraft: aliensshallrule

Posted 25 March 2013 - 11:05 PM

code?

#6

JanitorialMilk
  • Location: Planet X

Posted 25 March 2013 - 11:21 PM

May I see your code?
lalalalalalalalala :)

#7

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 25 March 2013 - 11:24 PM

package net.minecraft.src;

public class Mod_moswordsandmobs extends BaseMod{


public static final Item emeraldsword = (new ItemSword(1000, EnumToolMaterial.REALEMERALD).setUnlocalizedName("/Textures/emeraldsword")).setCreativeTab(CreativeTabs.tabCombat);

public void load() {
ModLoader.addName(emeraldsword, "Emerald Sword");
ModLoader.addRecipe(new ItemStack(emeraldsword, 1), new Object[]{
"WWW", "WWW", "WWW", 'W', Block.dirt,
});
}
public String getVersion() {
return "More Swords and Mobs Mod v1.0";
}

}

#8

JanitorialMilk
  • Location: Planet X

Posted 25 March 2013 - 11:31 PM

Ah. In your setUnlocalized name, remove the "/Textures/". That should fix it, as long as your texture is in minecraft.jar -> textures -> items.
lalalalalalalalala :)

#9

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 25 March 2013 - 11:43 PM

Nonono- like the item isnt even there. When I craft it nothing happends. I hover over the slot- but it doesnt appear. I didnt have this problem in 1.4 D:

#10

JanitorialMilk
  • Location: Planet X

Posted 25 March 2013 - 11:52 PM

Try changing the item id from 1000 to a different, higher number.
lalalalalalalalala :)

#11

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 26 March 2013 - 12:30 AM

Still nothing

#12

JanitorialMilk
  • Location: Planet X

Posted 26 March 2013 - 01:12 AM

I think I know the error. Change your mod's class name from Mod_moswordsandmobs to mod_moswordsandmobs.
lalalalalalalalala :)

#13

JanitorialMilk
  • Location: Planet X

Posted 26 March 2013 - 02:35 AM

But still remove the "/Textures/".
lalalalalalalalala :)

#14

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 26 March 2013 - 02:52 AM

Ok, will do

#15

MinecraftDonut
  • Location: Minecraftia
  • Minecraft: Reshiram314

Posted 26 March 2013 - 03:38 AM

Ok, but Im still lost. I see other people making 1.5.1 mods- but what am I doing wrong??? Here is the new code:
package net.minecraft.src;
public class Mod_moswordsandmobs extends BaseMod{
public static final Block awesome = (new Block(170, Material.glass));
public static final Item emeraldsword = (new ItemSword(2000, EnumToolMaterial.REALEMERALD).setUnlocalizedName("emeraldsword")).setCreativeTab(CreativeTabs.tabCombat);

public void load() {
  ModLoader.addName(emeraldsword, "Emerald Sword");
  ModLoader.addShapelessRecipe(new ItemStack(emeraldsword, 1), new Object[]{
  "W", 'W', Block.dirt
  });
  ModLoader.registerBlock(awesome);
  ModLoader.addName(awesome, "Awesome");
}
public String getVersion() {
  return "More Swords and Mobs Mod v1.0";
}
}
I also tested a block that I called awesome.(no texture- it should make it just a purple block)

Never mind- you renaming idea worked!!! THANK YOU SO MUCH!!!!

#16

JanitorialMilk
  • Location: Planet X

Posted 26 March 2013 - 03:54 AM

No problem. I am very happy to help. You should let me play with your mod when you're done. I love me some mods xD
lalalalalalalalala :)

#17

gandalf_the_green

Posted 28 March 2013 - 03:24 AM

Ok, im new to this, but how would i set a damage value to a block i created, and also how do i get it to be Mineable.

#18

LeThz
    LeThz

    The Meaning of Life, the Universe, and Everything...

  • Members
  • 42 posts

Posted 28 March 2013 - 12:21 PM

Hi,
I have a problem
i can't decompile
Is say decompiling...
next says Decompile feiled :/
And gives alot of errors!
Plese help me!
Pleseeeeeeeeeeeeeeeeeeeeee

#19

JanitorialMilk
  • Location: Planet X

Posted 28 March 2013 - 03:52 PM

View Postgandalf_the_green, on 28 March 2013 - 03:24 AM, said:

Ok, im new to this, but how would i set a damage value to a block i created, and also how do i get it to be Mineable.
To change the hardness, you add this to the end of your block code, but before the semicolon:
.setHardness(1.0F)
Change the 1.0 to what you want, but keep the F at the end, otherwise you will get errors. And what do you mean by mine-able?  Do you mean having it randomly generate over the terrain? If so, ModLoader seems to have an error with that for 1.5.1, but I'll try to fix that (or wait for an update, whichever comes first) and tell you how to fix that and how to then make it mine-able.

View PostLeThz, on 28 March 2013 - 12:21 PM, said:

Hi,
I have a problem
i can't decompile
Is say decompiling...
next says Decompile feiled :/
And gives alot of errors!
Plese help me!
Pleseeeeeeeeeeeeeeeeeeeeee
Can you post the errors please?
lalalalalalalalala :)

#20

mcadit
    mcadit

    Out of the Water

  • Members
  • 2 posts

Posted 28 March 2013 - 09:25 PM

package net.minecraft.src;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

public class mod_Carpet extends BaseMod{
public static final Block carpet = (new Block(170, Material.grass));

public void load() {
ModLoader.registerBlock(carpet);
ModLoader.addName(carpet, "Carpet");
};
public String getVersion() {
return "Carpet Mod";
}
}

I made this code but it is saying that it is registering null, any help please?