You are viewing our Forum Archives. To view or take place in current topics click here.
Are these good tutorials? Sticky?
Yes deserves a sticky!
66.34% (67 votes)
66.34% (67 votes)
There good but not sticky worthy
13.86% (14 votes)
13.86% (14 votes)
There not good
19.80% (20 votes)
19.80% (20 votes)
Total Votes: 101
#31. Posted:
Status: Offline
Joined: Dec 23, 201014Year Member
Posts: 2,446
Reputation Power: 80
-Post- wrote Nice guide,I will try this.
You should, there not hard and its fun to make mods
- 0useful
- 0not useful
#32. Posted:
Status: Offline
Joined: Feb 01, 201212Year Member
Posts: 4
Reputation Power: 0
Status: Offline
Joined: Feb 01, 201212Year Member
Posts: 4
Reputation Power: 0
Hi, I just started creating mods for minecraft. I thought I'd try out MCP. I'm trying to make a simple mod to add a new item to the game before I move on to bigger things. Would you mind telling me where my error is in this:
package net.minecraft.src;
public class mod_Baconator extends BaseMod
{
public mod_Baconator()
{
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/Items/bacon.png");
ModLoader.AddName(bacon, "Bacon");
ModLoader.AddRecipe(new ItemStack(bacon, 4), new Object[] {
" X ", Character.valueOf('X'), ItemFood.porkRaw
});
world = ModLoader.getMinecraftInstance().theWorld;
bacon = new ItemFood(501, 2, true);
bacon.setItemName("bacon");
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return "1.0";
}
@Override
public void load() {
// TODO Auto-generated method stub
}
public static ItemFood bacon;
World world;
}
Here's my error message when I run it:
java.lang.NullPointerException
at net.minecraft.src.mod_Baconator.<init>(mod_Baconator.java:7)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:234)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1217)
at net.minecraft.src.ModLoader.init(ModLoader.java:708)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:150)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
at net.minecraft.client.Minecraft.run(Minecraft.java:620)
at java.lang.Thread.run(Unknown Source)
package net.minecraft.src;
public class mod_Baconator extends BaseMod
{
public mod_Baconator()
{
bacon.iconIndex = ModLoader.addOverride("/gui/items.png", "/Items/bacon.png");
ModLoader.AddName(bacon, "Bacon");
ModLoader.AddRecipe(new ItemStack(bacon, 4), new Object[] {
" X ", Character.valueOf('X'), ItemFood.porkRaw
});
world = ModLoader.getMinecraftInstance().theWorld;
bacon = new ItemFood(501, 2, true);
bacon.setItemName("bacon");
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return "1.0";
}
@Override
public void load() {
// TODO Auto-generated method stub
}
public static ItemFood bacon;
World world;
}
Here's my error message when I run it:
java.lang.NullPointerException
at net.minecraft.src.mod_Baconator.<init>(mod_Baconator.java:7)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:234)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1217)
at net.minecraft.src.ModLoader.init(ModLoader.java:708)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:150)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:78)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:9)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:316)
at net.minecraft.client.Minecraft.run(Minecraft.java:620)
at java.lang.Thread.run(Unknown Source)
- 0useful
- 0not useful
#33. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
my tool/wep doesn;t get damage. I can achieve the effect that I want. Which class do I modify?
- 0useful
- 0not useful
#34. Posted:
Status: Offline
Joined: Feb 01, 201212Year Member
Posts: 4
Reputation Power: 0
Status: Offline
Joined: Feb 01, 201212Year Member
Posts: 4
Reputation Power: 0
Okay, I figured it out, but when I run reobfuscate.bat, it doesn't create any files in the directory "reobf". Why is this?
- 0useful
- 0not useful
#35. Posted:
Status: Offline
Joined: Dec 23, 201014Year Member
Posts: 2,446
Reputation Power: 80
ok first put your code into [code] tags and when you finish your code run recompile and THEN run reobf
- 0useful
- 0not useful
#36. Posted:
Status: Offline
Joined: Dec 23, 201014Year Member
Posts: 2,446
Reputation Power: 80
99rock99 wrote my tool/wep doesn;t get damage. I can achieve the effect that I want. Which class do I modify?
what are you trying to do, make a sword with special effects or just make a normal sword
- 0useful
- 0not useful
#37. Posted:
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
Status: Offline
Joined: May 22, 201113Year Member
Posts: 235
Reputation Power: 9
sackorice wrote99rock99 wrote my tool/wep doesn;t get damage. I can achieve the effect that I want. Which class do I modify?
what are you trying to do, make a sword with special effects or just make a normal sword
I am making a staff. I used the code for a hoe, because of the left clock, but now I would like it to get damage when the special ability is used. my whole code for the item is this
package net.minecraft.src;
public class mod_ItemLvlStaff extends mod_ItemToolMidas
{
public mod_ItemLvlStaff(int i, mod_EnumToolMaterialMidasTools enumtoolmaterial)
{
super(i, i, toolMaterial, blocksEffectiveAgainst);
maxStackSize = 1;
setMaxDamage(enumtoolmaterial.getMaxUses());
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
int i1 = world.getBlockId(i, j, k);
int j1 = world.getBlockId(i, j + 1, k);
itemstack.damageItem(1, entityplayer);
return true;
}
public boolean isFull3D()
{
return true;
}
}
what do I add in to add damage?
- 0useful
- 0not useful
#38. Posted:
Status: Offline
Joined: Dec 23, 201014Year Member
Posts: 2,446
Reputation Power: 80
99rock99 wrotesackorice wrote99rock99 wrote my tool/wep doesn;t get damage. I can achieve the effect that I want. Which class do I modify?
what are you trying to do, make a sword with special effects or just make a normal sword
I am making a staff. I used the code for a ****, because of the left clock, but now I would like it to get damage when the special ability is used. my whole code for the item is this
package net.minecraft.src;
public class mod_ItemLvlStaff extends mod_ItemToolMidas
{
public mod_ItemLvlStaff(int i, mod_EnumToolMaterialMidasTools enumtoolmaterial)
{
super(i, i, toolMaterial, blocksEffectiveAgainst);
maxStackSize = 1;
setMaxDamage(enumtoolmaterial.getMaxUses());
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
int i1 = world.getBlockId(i, j, k);
int j1 = world.getBlockId(i, j + 1, k);
itemstack.damageItem(1, entityplayer);
return true;
}
public boolean isFull3D()
{
return true;
}
}
what do I add in to add damage?
Im not exactly positive on what to change, ive never tried to make a custom weapon but i think that it is this code that you change (the number)
itemstack.damageItem(1, entityplayer);
return true;
and if that doesnt work then add this
damage = (number of damage)
into
public mod_ItemLvlStaff(int i, mod_EnumToolMaterialMidasTools enumtoolmaterial)
{
super(i, i, toolMaterial, blocksEffectiveAgainst);
maxStackSize = 1;
setMaxDamage(enumtoolmaterial.getMaxUses());
}
- 0useful
- 0not useful
#39. Posted:
Status: Offline
Joined: Jan 15, 201114Year Member
Posts: 2,316
Reputation Power: 119
Status: Offline
Joined: Jan 15, 201114Year Member
Posts: 2,316
Reputation Power: 119
Nice tutorial!! I think it deserves some credit.
- 0useful
- 0not useful
#40. Posted:
Status: Offline
Joined: Dec 23, 201014Year Member
Posts: 2,446
Reputation Power: 80
-Dog wrote Nice tutorial!! I think it deserves some credit.
thanks! this is what inspires me to do tutorials, i wish this got some credit... always gets pushed the back of the forum
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.