I need a bit of help with a sort of minion mod I'm working on, where the "temptitem" which makes them
follow you is a custom item called "Command Staff". They follow any pre-made item I use as a command
staff, and the command staff itself isn't having any errors, but the crafting recipe doesen't work. Here is
the code.
mod_commandstaff (The item)
package net.minecraft.src;
public class mod_commandstaff extends BaseMod
{
public static final Item commandStaff = new Item(5000).setItemName("Command staff");//creates an item with an id of 5000
public String getVersion()
{
return "1.4.7";
}
public void load()
{
testItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/commandstaffimg.png");//sets the image of the item to a image called test.png notice test.png should be placed in bin/minecraft if you are using mcp or just in src if you are using eclipse, when you use your mod for real it just gets fropped in the jar
testItem.setCreativeTab(CreativeTabs.tabMisc);
ModLoader.addName(testItem, "CommandStaff");
}
}
I need a bit of help with a sort of minion mod I'm working on, where the "temptitem" which makes them
follow you is a custom item called "Command Staff". They follow any pre-made item I use as a command
staff, and the command staff itself isn't having any errors, but the crafting recipe doesen't work. Here is
the code.
mod_commandstaff (The item)
package net.minecraft.src;
public class mod_commandstaff extends BaseMod
{
public static final Item commandStaff = new Item(5000).setItemName("Command staff");//creates an item with an id of 5000
public String getVersion()
{
return "1.4.7";
}
public void load()
{
testItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/commandstaffimg.png");//sets the image of the item to a image called test.png notice test.png should be placed in bin/minecraft if you are using mcp or just in src if you are using eclipse, when you use your mod for real it just gets fropped in the jar
testItem.setCreativeTab(CreativeTabs.tabMisc);
ModLoader.addName(testItem, "CommandStaff");
}
}
Can somebody a total noob? I want make my villager to spawn via villager egg, also make them spawn on villages
Here is my mod.java
package net.minecraft.src;
import java.util.Map;
import org.lwjgl.util.Color;
public class mod_BetterVillages extends BaseMod
{
public String getVersion()
{
return "1.4.7";
}
public void load() {
ModLoader.registerEntityID(EntityVillagerGuard.class, "Village Guard", 12);//registers the mobs name and id
ModLoader.addSpawn("Village Guard", 5, 1, 1, EnumCreatureType.creature);//makes the mob spawn in game see bottom
ModLoader.addLocalization("entity.Village Guard.name", "Village Guard");//adds the name of the mob to the spawn egg
EntityList.entityEggs.put(Integer.valueOf(12), new EntityEggInfo(12, 894731, (new Color(118, 207, 83)).getRed()));//creates the spawn egg of the specified colors you will have to mess around with it
}
public void addRenderer(Map var1)
{
var1.put(EntityVillagerGuard.class, new RenderLiving(new ModelVillager(0),.5f));//says that the pigman should use the living renderer and the biped model note you can change the renderer and the model
}
}
And this is my Entity class
package net.minecraft.src;
public class EntityVillagerGuard extends EntityVillager//extend this to make mob hostile
{
public EntityVillagerGuard(World par1World)
{
super(par1World);//super call
this.texture = "/mob/villager/villager.png";//specifies texture
this.moveSpeed = .4f;//sets how fast this mob moves
//below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityZombie.class, this.moveSpeed, true));
this.tasks.addTask(2, new EntityAIMoveThroughVillage(this, 0.16F, true));
this.tasks.addTask(3, new EntityAIMoveTwardsRestriction(this, this.moveSpeed));
this.tasks.addTask(4, new EntityAIWander(this, this.moveSpeed));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityZombie.class, 16.0F, 0, true));
//end of ai tasks
}
//the amount of damge the mob does i think
public int func_82193_c(Entity par1Entity)
{
return 3;
}
public int getMaxHealth()//says that the mob will have a health of 20
{
return 22;
}
public boolean isAIEnabled()//says that the tasks we told it to do before will be run
{
return true;
}
}
get galop i noticed after testing what i made with your "mob that player creates" tutorial the mob doesnt spawn, and could you further expand on "register the block in your mod_ class" that would be great
get galop i noticed after testing what i made with your "mob that player creates" tutorial the mob doesnt spawn, and could you further expand on "register the block in your mod_ class" that would be great
I'm having a bit of a rpoblem aniating a model in made in Techne.
When I try to recompile, it says "The formal argument differs in lenth from the actual argument"
or something like that. From this model code, can you tell me what went wrong?
I'm having a bit of a rpoblem aniating a model in made in Techne.
When I try to recompile, it says "The formal argument differs in lenth from the actual argument"
or something like that. From this model code, can you tell me what went wrong?
follow you is a custom item called "Command Staff". They follow any pre-made item I use as a command
staff, and the command staff itself isn't having any errors, but the crafting recipe doesen't work. Here is
the code.
mod_commandstaff (The item)
package net.minecraft.src; public class mod_commandstaff extends BaseMod { public static final Item commandStaff = new Item(5000).setItemName("Command staff");//creates an item with an id of 5000 public String getVersion() { return "1.4.7"; } public void load() { testItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/commandstaffimg.png");//sets the image of the item to a image called test.png notice test.png should be placed in bin/minecraft if you are using mcp or just in src if you are using eclipse, when you use your mod for real it just gets fropped in the jar testItem.setCreativeTab(CreativeTabs.tabMisc); ModLoader.addName(testItem, "CommandStaff"); } }mod_craftstaff (The recipe)
ModLoader.addRecipe(new ItemStack(Item.commandStaff, 1), new Object [] {" * ", " # ", " # ", Character.valueOf ('#'), Item.ingotGold, Character.valueOf('*'), Item.enderPearl});When I try to recompile, it says that I need an interace, class or enum. Please tell me what that
means and how to fix it.
Its because in here:
ModLoader.addRecipe(new ItemStack([u]Item.commandStaff, 1[/u]), new Object [] {" * ", " # ", " # ", Character.valueOf ('#'), Item.ingotGold, Character.valueOf('*'), Item.enderPearl});You need to change it to mod_commandstaff.commandStaff
the creepers spaz out probably an AI glitch
Here is my code:
ModLoader.addShapelessRecipe(new ItemStack(Item.SandstoneShard), new Object[] {Block.sandStone});ModLoader.addShapelessRecipe(new ItemStack(mod_urmod.SandstoneShard), new Object[] {Block.sandStone});
example:
ModLoader.addReicipe(new ItemStack(mod_******.SandstoneShard, 1), new Object [ ] { "*", Character.valueOf('*'), Block.sandStone});But I'm pretty sure the shapelessRecipe will work too. This is just a different way.
But seriously, can you make a sound tutorial? I really need custom sounds....
Bleach Mod
Here is my mod.java
package net.minecraft.src; import java.util.Map; import org.lwjgl.util.Color; public class mod_BetterVillages extends BaseMod { public String getVersion() { return "1.4.7"; } public void load() { ModLoader.registerEntityID(EntityVillagerGuard.class, "Village Guard", 12);//registers the mobs name and id ModLoader.addSpawn("Village Guard", 5, 1, 1, EnumCreatureType.creature);//makes the mob spawn in game see bottom ModLoader.addLocalization("entity.Village Guard.name", "Village Guard");//adds the name of the mob to the spawn egg EntityList.entityEggs.put(Integer.valueOf(12), new EntityEggInfo(12, 894731, (new Color(118, 207, 83)).getRed()));//creates the spawn egg of the specified colors you will have to mess around with it } public void addRenderer(Map var1) { var1.put(EntityVillagerGuard.class, new RenderLiving(new ModelVillager(0),.5f));//says that the pigman should use the living renderer and the biped model note you can change the renderer and the model } }And this is my Entity class
package net.minecraft.src; public class EntityVillagerGuard extends EntityVillager//extend this to make mob hostile { public EntityVillagerGuard(World par1World) { super(par1World);//super call this.texture = "/mob/villager/villager.png";//specifies texture this.moveSpeed = .4f;//sets how fast this mob moves //below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityZombie.class, this.moveSpeed, true)); this.tasks.addTask(2, new EntityAIMoveThroughVillage(this, 0.16F, true)); this.tasks.addTask(3, new EntityAIMoveTwardsRestriction(this, this.moveSpeed)); this.tasks.addTask(4, new EntityAIWander(this, this.moveSpeed)); this.tasks.addTask(5, new EntityAILookIdle(this)); this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityZombie.class, 16.0F, 0, true)); //end of ai tasks } //the amount of damge the mob does i think public int func_82193_c(Entity par1Entity) { return 3; } public int getMaxHealth()//says that the mob will have a health of 20 { return 22; } public boolean isAIEnabled()//says that the tasks we told it to do before will be run { return true; } }I iz wants help
Cheers!
Still doesen't work :/
Isn't there a special format for crafting custom items?
Ummmm in your mod_commandstaff:
public void load() { testItem.iconIndex = ModLoader.addOverride("/gui/items.png", "/commandstaffimg.png"); testItem.setCreativeTab(CreativeTabs.tabMisc); ModLoader.addName(testItem, "CommandStaff"); }Change all the testItem to commandStaff
Bleach Mod
idk but maybe try ShiftedIndex.commandStaff?
heres a video to show the problem with my entity
WTF Modding Fail
When I try to recompile, it says "The formal argument differs in lenth from the actual argument"
or something like that. From this model code, can you tell me what went wrong?
// Date: 1/21/2013 8:14:19 PM // Template version 1.1 // Java generated by Techne // Keep in mind that you still need to fill in some blanks // - ZeuX package net.minecraft.src; public class ModelPootpoot extends ModelBase { //fields ModelRenderer neck; ModelRenderer body; ModelRenderer leg1; ModelRenderer leg2; ModelRenderer tail; ModelRenderer head; ModelRenderer mouth; ModelRenderer stalk2; ModelRenderer stalk1; ModelRenderer eye1; ModelRenderer eye2; ModelRenderer wing2; ModelRenderer wing1; public ModelPootpoot() { textureWidth = 128; textureHeight = 50; neck = new ModelRenderer(this, 63, 1); neck.addBox(-4F, -4F, -8F, 6, 8, 5); neck.setRotationPoint(1F, 11F, -1F); neck.setTextureSize(128, 50); neck.mirror = true; setRotation(neck, 0F, 0F, 0F); body = new ModelRenderer(this, 28, 8); body.addBox(-5F, -10F, -7F, 8, 13, 8); body.setRotationPoint(1F, 11F, 2F); body.setTextureSize(128, 50); body.mirror = true; setRotation(body, 1.570796F, 0F, 0F); leg1 = new ModelRenderer(this, 36, 34); leg1.addBox(-2F, 0F, -2F, 3, 8, 3); leg1.setRotationPoint(-3F, 16F, -1F); leg1.setTextureSize(128, 50); leg1.mirror = true; setRotation(leg1, 0F, 0F, 0F); leg2 = new ModelRenderer(this, 23, 34); leg2.addBox(-2F, 0F, -2F, 3, 8, 3); leg2.setRotationPoint(4F, 16F, -1F); leg2.setTextureSize(128, 50); leg2.mirror = true; setRotation(leg2, 0F, 0F, 0F); tail = new ModelRenderer(this, 16, 20); tail.addBox(0F, 0F, 0F, 2, 9, 2); tail.setRotationPoint(-1F, 10F, 4F); tail.setTextureSize(128, 50); tail.mirror = true; setRotation(tail, 0.2974289F, 0F, 0F); head = new ModelRenderer(this, 0, 0); head.addBox(0F, 0F, 0F, 6, 6, 6); head.setRotationPoint(-3F, 1F, -10F); head.setTextureSize(128, 50); head.mirror = true; setRotation(head, 0F, 0F, 0F); mouth = new ModelRenderer(this, 0, 36); mouth.addBox(0F, 0F, 0F, 2, 2, 7); mouth.setRotationPoint(-1F, 3F, -17F); mouth.setTextureSize(128, 50); mouth.mirror = true; setRotation(mouth, 0F, 0F, 0F); stalk2 = new ModelRenderer(this, 0, 9); stalk2.addBox(0F, 0F, 0F, 1, 5, 1); stalk2.setRotationPoint(3F, -2F, -8F); stalk2.setTextureSize(128, 50); stalk2.mirror = true; setRotation(stalk2, 0F, 0F, 0.2974289F); stalk1 = new ModelRenderer(this, 0, 5); stalk1.addBox(0F, 0F, 0F, 1, 5, 1); stalk1.setRotationPoint(-4F, -2F, -8F); stalk1.setTextureSize(128, 50); stalk1.mirror = true; setRotation(stalk1, 0F, 0F, -0.2610765F); eye1.mirror = true; eye1 = new ModelRenderer(this, 38, 0); eye1.addBox(0F, 0F, 0F, 3, 3, 3); eye1.setRotationPoint(2F, -4F, -9F); eye1.setTextureSize(128, 50); eye1.mirror = true; setRotation(eye1, 0F, 0F, 0F); eye1.mirror = false; eye2 = new ModelRenderer(this, 24, 0); eye2.addBox(0F, 0F, 0F, 3, 3, 3); eye2.setRotationPoint(-5F, -4F, -9F); eye2.setTextureSize(128, 50); eye2.mirror = true; setRotation(eye2, 0F, 0F, 0F); wing2 = new ModelRenderer(this, 0, 16); wing2.addBox(0F, 0F, 0F, 0, 13, 7); wing2.setRotationPoint(5F, 9F, -6F); wing2.setTextureSize(128, 50); wing2.mirror = true; setRotation(wing2, 0F, -0.4833219F, -0.7807508F); wing1 = new ModelRenderer(this, 0, 16); wing1.addBox(0F, 0F, 0F, 0, 13, 7); wing1.setRotationPoint(0F, 8F, 0F); wing1.setTextureSize(128, 50); wing1.mirror = true; setRotation(wing1, 0F, -2.453788F, -0.7807508F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); neck.render(f5); body.render(f5); leg1.render(f1); leg2.render(f2); tail.render(f5); head.render(f3); mouth.render(f3); stalk2.render(f3); stalk1.render(f3); eye1.render(f3); eye2.render(f3); wing2.render(f4); wing1.render(f4); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5); } }Try changing all of the
to
But the real problem is that you have two eye1.mirror = true; and one eye1.mirror = false;
Get rid of the false and one of the true
Bleach Mod
Well, I decided to try what you said...and it went from 1 error to 14 errors.