Can you post how you fixed it, so other people can learn from it?
What do you want it to drop?
If you look at entityboat, you will see this method:
public boolean attackEntityFrom(DamageSource damagesource, int i)
{
if (worldObj.multiplayerWorld || isDead)
{
return true;
}
setForwardDirection(-getForwardDirection());
setTimeSinceHit(10);
setDamageTaken(getDamageTaken() + i * 10);
setBeenAttacked();
if (getDamageTaken() > 40)
{
if (riddenByEntity != null)
{
riddenByEntity.mountEntity(this);
}
for (int j = 0; j < 3; j++)
{
dropItemWithOffset(Block.planks.blockID, 1, 0.0F);
}
for (int k = 0; k < 2; k++)
{
dropItemWithOffset(Item.stick.shiftedIndex, 1, 0.0F);
}
setEntityDead();
}
return true;
}
This looks like the drop code with a dropItemWithOffset for 2 sticks (it runs through the for loop 2 times)and 3 planks (it runs through the for loop 2 times) :wink.gif:
Copy and paste this into your EntityReinforcedBoat and replace the dropItemWithOffset with what you want it to drop.
Actually. the way I fixed it was very easy. You just had to add
import java.util.Map
to the first few lines of the mod_insertnamehere.class . And I fixed the dropping problem by making it extend Entity instead of EntityBoat, and changing other stuff around, as when i extended EntityBoat it took on the drop method of the Boat as well.
It mean that every abstract method from EntityThrowable has to be in your Entity****
Easiest way to do this in eclipse is hover over the error and select "implement abstract methods" or something like that.
Thanks for that but i have another question, now when i do "map.put(net.minecraft.src.Entity****.class(etc.. etc..) "map" is underlined and says it cannot be resolved so my question is, has that changed now in 1.1 too? :huh.gif:
If you get an error, hover your mouse over it and it will often show you the solution.
You have to import map from java utils :wink.gif:
No, see thats the thing, i already know to do those things but there is no option to import it and when i type it in manually it still is incorrect and ive refreshed eclipse and everything which was why i was wondering "map" was changed to somthing else like "world.entityJoinedWorld" changed to "world.spawnEntityInWorld".
EDIT: Its because im stupid and forgot to put on top of that "public void AddRenderer(Map map) {" :dry.gif:
No, see thats the thing, i already know to do those things but there is no option to import it and when i type it in manually it still is incorrect and ive refreshed eclipse and everything which was why i was wondering "map" was changed to somthing else like "world.entityJoinedWorld" changed to "world.spawnEntityInWorld".
Everything is the same as in my tutorial, I didn't have to replace any spawning code for my blockium monster. There is a source code download I just updated yesterday if you want to compare the code.
Alright... so now i got the bomb to work when i right click it will throw it but it doesn't explode on contact and when i throw it, it comes out as a small grey block.. im pretty sure the small grey block is because i didn't set a render for it? anyway here is my code in case you know how to fix it.. [
ENTIY****
public class Entity**** extends EntityThrowable
{
public Entity****(World world)
{
super(world);
}
public Entity****(World world, EntityLiving entityliving)
{
super(world, entityliving);
}
i had to add this code part for some reason ->@Override
protected void onThrowableCollision(MovingObjectPosition movingobjectposition) {
// TODO Auto-generated method stub <-
}
I Haven't watched to many of your tuts, but I don't know where else to go to post this, so, here are my errors.
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.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 ModLoader.addMod(ModLoader.java:275)
at ModLoader.readFromClassPath(ModLoader.java:1227)
at ModLoader.init(ModLoader.java:825)
at ModLoader.AddAllRenderers(ModLoader.java:186)
at wb.<init>(wb.java:76)
at wb.<clinit>(wb.java:9)
at net.minecraft.client.Minecraft.a(SourceFile:265)
at net.minecraft.client.Minecraft.run(SourceFile:644)
at java.lang.Thread.run(Unknown Source)
My EntityEndermanMan.java code.
package net.minecraft.src;
public abstract class EntityEndermanMan extends EntityMob
{
public EntityEndermanMan(World world)
{
super(world);
//Set the texture
texture = "/EndermanMan.png";
//Set the size of the hitbox
setSize(1.3F,1.3F);
//Set the speed of the mob
//NOTE: 0 = 0% speed, 1 = 100%, 0.75 = 75%
moveSpeed = 20F;
//Set how much health the mob has
health = 50;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
//Need audiomod for the next 3. Remove them if you want a silent mob (except for the sound of foot steps)
//You can also go into the entity files for other mobs and take their sounds if you want (the way I did in the video)
protected String getLivingSound()
{
//This is what sound the mob makes when living
return "mob.endermen.idle";
}
protected String getHurtSound()
{
//This is what sound the mob makes when getting hurt
return "mob.enderman.hit";
}
protected String getDeathSound()
{
//This is what sound the mob makes when dying
return "mob.endermen.death";
}
//Here's where you change the volume of the mob's sounds
protected float getSoundVolume()
{
return 0.4F;
}
//Here you define what items or blocks you want the mob to drop when killed
protected int getDropItemId()
{
return Item.enderPearl.shiftedIndex;
}
}
public abstract class mod_EndermanMan extends BaseMod
{
public mod_EndermanMan()
{
AddMobs();
}
public void AddMobs()
{
//This line just registers the mob, and sets a name for it, as well as it's own unique entity ID
ModLoader.RegisterEntityID(EntityEndermanMan.class, "Ender-Steve", ModLoader.getUniqueEntityId());
//This line makes tells the mob to spawn. The number 500 is how rare the mob is
//EnumCreatureType.creature = land mob, EnumCreatureType.waterCreature = water mob,
//EnumCreatureType.monster = a hostile mob that only spawns in darkness
ModLoader.AddSpawn(EntityEndermanMan.class, 1,1,1, EnumCreatureType.monster);
}
public void AddRenderer(Map map)
{
map.put(EntityEndermanMan.class, new RenderEndermanMan(new ModelEndermanMan(), 0.5F));
}
public String Version()
{
return "EndermanMan v1";
}
}
My ModelEndermanMan.java file.
package net.minecraft.src;
public class ModelEndermanMan extends ModelBiped
{
public ModelEndermanMan()
{
super(1, 0.0F);
}
}
public class RenderEndermanMan extends RenderLiving
{
//The three numbers below change the size of your model (you'll need to change the hitbox size too though)
protected void preRenderScale(EntityEndermanMan entity, float f)
{
GL11.glScalef(1F, 1F, 1F);
}
public RenderEndermanMan(ModelEndermanMan modelbase, float f)
{
super(modelbase, f);
}
Try adding to you block the method:
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
And in there something like:
dropBlockAsItem_do(world, i, j, k, new ItemStack(HERE YOUR BLOCK ID, 1, damageDropped(l))); //will drop the block itself
dropBlockAsItem_do(world, i, j, k, new ItemStack(YOUR ITEM HERE AND NOT ITEM ID, 1, damageDropped(l))); //will drop the item
This is how Ive set it up so far
int randomNum;
int randomNum2;
int randomNum3;
boolean gotCobble;
public int idDropped(int i, Random random, int j)
{
randomNum = rand.nextInt(99)+1;
if(randomNum>=1 && randomNum<=10)
{
gotCobble=false;
return Item.goldNugget.shiftedIndex;
}
else if(randomNum>=10 && randomNum<=25)
{
gotCobble=false;
return Item.bone.shiftedIndex;
}
else if(randomNum>=30 && randomNum<=45)
{
gotCobble=false;
return mod_MiningOverhaul.ironChunk.shiftedIndex;
}
else
{
gotCobble=true;
return Block.cobblestone.blockID;
}
}
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
{
randomNum2=rand.nextInt(24)+1;
if(randomNum2==1)
world.spawnEntityInWorld(new EntityXPOrb( world, i, j, k, 1));
randomNum3=rand.nextInt(74)+1;
if(randomNum3==7)
world.spawnEntityInWorld(new EntityXPOrb( world, i, j, k, rand.nextInt(4)+1));
if(!gotCobble)
{
dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.cobblestone.blockID, 1, damageDropped(l))); //will drop the block itself
}
if (world.multiplayerWorld)
{
return;
}
int j1 = quantityDroppedWithBonus(i1, world.rand);
for (int k1 = 0; k1 < j1; k1++)
{
if (world.rand.nextFloat() > f)
{
continue;
}
int l1 = idDropped(l, world.rand, i1);
if (l1 > 0)
{
dropBlockAsItem_do(world, i, j, k, new ItemStack(l1, 1, damageDropped(l)));
}
}
}
But what happens is tht occasionally the cobble drops two blocks hwen mined, and other times it doesnt drop stone when a different item is dropped.
Im trying to just have it be a simple boolean. If the block drops something other than cobble, it becomes false. The flase boolean triggers the event of a cobble dropping.
ive made a block that faces you when you place it and im wondering how to make the top/bottom textures rotate with it. does anyone know how?
id also like to know how to make a multi-function tool(that mabey switches textures(flips) when, for example, mining or cutting wood), and how to make a recipe repair a tool thats in the crafting grid(like a pickaxe with some iron repairs it a little, or comletely)
27 achievements
174 recipes
ModLoader 1.1 Initializing...
CONFLICT @ 2005
CONFLICT @ 2006
CONFLICT @ 2007
CONFLICT @ 2008
CONFLICT @ 2009
Mod Initialized: mod_Aft 1.0.1
Overriding /terrain.png with /Aft/steel.png @ 30. 43 left.
Overriding /terrain.png with /Aft/rsteel.png @ 153. 42 left.
Overriding /terrain.png with /Aft/storch.png @ 168. 41 left.
Overriding /gui/items.png with /Aft/dust.png @ 38. 85 left.
Overriding /gui/items.png with /Aft/Ice.png @ 102. 84 left.
Overriding /gui/items.png with /Aft/rdust.png @ 118. 83 left.
Overriding /gui/items.png with /Aft/soda.png @ 119. 82 left.
Overriding /gui/items.png with /Aft/grape.png @ 120. 81 left.
Overriding /gui/items.png with /Aft/bottle.png @ 134. 80 left.
Overriding /gui/items.png with /Aft/pick.png @ 144. 79 left.
Overriding /gui/items.png with /Aft/spade.png @ 145. 78 left.
Overriding /gui/items.png with /Aft/axe.png @ 146. 77 left.
Overriding /gui/items.png with /Aft/hoe.png @ 147. 76 left.
Overriding /gui/items.png with /Aft/sword.png @ 148. 75 left.
Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError
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)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at net.minecraft.src.ModLoader.init(ModLoader.java:745)
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)
... 3 more
Caused by: java.lang.NullPointerException
at net.minecraft.src.CraftingManager.addRecipe(CraftingManager.java:361)
at net.minecraft.src.ModLoader.AddRecipe(ModLoader.java:344)
at net.minecraft.src.mod_Aft.load(mod_Aft.java:107)
at net.minecraft.src.ModLoader.init(ModLoader.java:714)
... 6 more
mod_Aft.java....
//Location
package net.minecraft.src;
//stuff for mob/block spawning
import java.util.Map;
import java.util.Random;
//Class
public class mod_Aft extends BaseMod
{
//Block Definitions
public static Block Steel = new BlockSteel(234, 0).setHardness(5.0F).setResistance(10F).setLightValue(0.0F).setBlockName("Steel");
public static Block Refinedsteel = new BlockRefinedsteel(235, 0).setHardness(6.0F).setResistance(11F).setLightValue(0.0F).setBlockName("Refined Steel");
public static Block Storch = new BlockStorch(236, 0).setHardness(0.021F).setResistance(5.0F).setLightValue(0.987F).setBlockName("Steel Torch");
//Item Definitions
public static final Item Dust = new Item(2334).setItemName("Steel Dust");
public static final Item Icecube = new Item(2335).setItemName("Ice Cubes");
public static final Item Refinedingot = new Item(416).setItemName("Refined Steel Ingot");
public static final Item Bottle = new Item(2338).setItemName("Bottle");
public static final Item Soda = new ItemFood(2336, 4, false).setItemName("Soda");
public static final Item Grape = new ItemFood(2337, 2, false).setItemName("Grape");
//Tool Definitions
public static final Item SteelPickaxe = new ItemPickaxe(2005, EnumToolMaterial.IRON).setItemName("Refined Steel Pickaxe");
public static final Item SteelSpade = new ItemSpade(2006, EnumToolMaterial.IRON).setItemName("Refined Steel Shovel");
public static final Item SteelAxe = new ItemAxe(2007, EnumToolMaterial.IRON).setItemName("Refined Steel Axe");
public static final Item SteelHoe = new ItemHoe(2008, EnumToolMaterial.IRON).setItemName("Refined Steel Hoe");
public static final Item SteelSword = new ItemSword(2009, EnumToolMaterial.IRON).setItemName("Refined Steel Sword");
public String getVersion()
{
//Mod Version
return "1.0.1";
}
public mod_Aft()
{
//Register Mob
ModLoader.RegisterEntityID(EntityAft.class, "Aft", 117);
}
public void load()
{
//Register Blocks
ModLoader.RegisterBlock(Steel);
ModLoader.RegisterBlock(Refinedsteel);
ModLoader.RegisterBlock(Storch);
//Textures
Steel.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Aft/steel.png");
Refinedsteel.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Aft/rsteel.png");
Storch.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Aft/storch.png");
Dust.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/dust.png");
Icecube.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/Ice.png");
Refinedingot.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/rdust.png");
Soda.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/soda.png");
Grape.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/grape.png");
Bottle.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/bottle.png");
SteelPickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/pick.png");
SteelSpade.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/spade.png");
SteelAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/axe.png");
SteelHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/hoe.png");
SteelSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/Aft/sword.png");
//Names for stuff...
ModLoader.AddName(Steel, "Steel");
ModLoader.AddName(Refinedsteel, "Refined Steel");
ModLoader.AddName(Storch, "Steel Torch");
ModLoader.AddName(Dust, "Steeel Dust");
ModLoader.AddName(Icecube, "Ice cubes");
ModLoader.AddName(Refinedingot, "Refined Steel Ingot");
ModLoader.AddName(Soda, "Soda");
ModLoader.AddName(Grape, "Grape");
ModLoader.AddName(Bottle, "Bottle");
ModLoader.AddName(SteelPickaxe, "Refined Steel Pickaxe");
ModLoader.AddName(SteelSpade, "Refined Steel Shovel");
ModLoader.AddName(SteelAxe, "Refined Steel Axe");
ModLoader.AddName(SteelHoe, "Refined Steel Hoe");
ModLoader.AddName(SteelSword, "Refined Steel Sword");
//Crafting recipes
/*ModLoader.AddRecipe(new ItemStack(Steel, 1), new Object[] {
"@@", "@@", Character.valueOf('@'), Block.dirt
});*/
ModLoader.AddRecipe(new ItemStack(Refinedsteel, 1), new Object[] {
"! ", Character.valueOf('!'), mod_Aft.Steel
});
/*ModLoader.AddRecipe(new ItemStack(Steel, 2), new Object[] {
"##", "##", Character.valueOf('#'), mod_Aft.Dust
});*/
ModLoader.AddRecipe(new ItemStack(SteelPickaxe, 1), new Object[] {
"###", " @ ", " @ ", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('@'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(SteelSpade, 1), new Object[] {
" # ", " ! ", " ! ", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('!'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(SteelAxe, 1), new Object[] {
" ##", " !#", " ! ", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('!'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(SteelHoe, 1), new Object[] {
"## ", " ! ", " ! ", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('!'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(SteelSword, 1), new Object[] {
" # ", " # ", " ! ", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('!'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(Storch, 7), new Object[] {
" #", " !", Character.valueOf('#'), mod_Aft.Refinedingot, Character.valueOf('!'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(Steel, 2), new Object[] {
"##", Character.valueOf('#'), mod_Aft.Refinedsteel
});
ModLoader.AddRecipe(new ItemStack(Soda, 2), new Object[] {
" @", " #", Character.valueOf('@'), mod_Aft.Bottle.shiftedIndex, Character.valueOf('#'), mod_Aft.Dust.shiftedIndex
});
ModLoader.AddRecipe(new ItemStack(Bottle, 2), new Object[] {
" # ", "# #", Character.valueOf('#'), mod_Aft.Refinedsteel.blockID
});
//smelting(furnace)
ModLoader.AddSmelting(mod_Aft.Refinedsteel.blockID, new ItemStack(mod_Aft.Refinedingot, 1));
ModLoader.AddSmelting(mod_Aft.Dust.shiftedIndex, new ItemStack(mod_Aft.Steel, 1));
ModLoader.AddSmelting(mod_Aft.Steel.blockID, new ItemStack(mod_Aft.Refinedsteel, 1));
//Spawn Mob
ModLoader.AddSpawn(EntityAft.class, 10, 4, 4, EnumCreatureType.creature);
world = ModLoader.getMinecraftInstance().theWorld;
}
World world;
public void AddRenderer(Map map)
{
map.put(EntityAft.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void GenerateSurface(World world, Random random, int i, int j)
{
for(int a = 0; a < 25; a++)
{
int posX = i + random.nextInt(16);
int posY = random.nextInt(128);
int posZ = j + random.nextInt(16);
(new WorldGenMinable(Steel.blockID, 8)).generate(world, random, posX, posY, posZ);
}
}
}
all others are default and all textures right
its coming from soda...
ItemSoda.java
package net.minecraft.src;
import java.util.Random;
public class ItemSoda extends ItemFood
{
public ItemSoda(int i, int j)
{
super(i, j, true);
maxStackSize = 16;
}
}
Please Help!!!And those commented recipes, its meant to be that way now to recipes' outcomes generate naturally
Can someone tell me plz how i make my mob only spawn in the villages
Ty in advance
you add the spawn in ComponentVillage.class, just do a ctrl+f for "EntityVillager" and you will find the spawning function, just copy the code and replace the EntityVillager and entityvillager and your entitynames.
Hello, I've been having alot of trouble getting my minecraft to properly render my pig modeled mob. Minecraft acts normally until a "DeathPig" spawns, and then it crashes instantly.
Here is my CrashLog.
Mods loaded: 3
ModLoader 1.1
mod_DeathPig 1.1
mod_Recipe 1.1
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT a57f03c --------
Generated 1/21/12 10:41 PM
Minecraft: Minecraft 1.1
OS: Windows 7 (x86) version 6.1
Java: 1.6.0_29, Sun Microsystems Inc.
VM: Java HotSpot(TM) Client VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics version 2.1.0 - Build 8.15.10.2509, Intel
java.lang.ClassCastException: net.minecraft.src.EntityDeathPig cannot be cast to net.minecraft.src.EntityPig
at net.minecraft.src.RenderPig.doRender(RenderPig.java:37)
at net.minecraft.src.RenderManager.renderEntityWithPosYaw(RenderManager.java:158)
at net.minecraft.src.RenderManager.renderEntity(RenderManager.java:149)
at net.minecraft.src.RenderGlobal.renderEntities(RenderGlobal.java:338)
at net.minecraft.src.EntityRenderer.renderWorld(EntityRenderer.java:900)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:739)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:17)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:737)
at net.minecraft.client.Minecraft.run(Minecraft.java:634)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 9379b136 ----------
package net.minecraft.src;
public class EntityDeathPig extends EntityMob
{
public EntityDeathPig(World world)
{
super(world);
texture = "/NinjaItems/deathpig.png";
moveSpeed = 0.8F;
attackStrength = 4;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound); // this saves the mob to disk, so it can be loaded later
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound); // this retrieves saved data about the mob from the hard drive
}
protected boolean canDespawn()
{
return false;
}
public void onLivingUpdate()
{
if (worldObj.isDaytime() && !worldObj.multiplayerWorld)
{
float f = getEntityBrightness(1.0F);
if (f > 0.5F && worldObj.canBlockSeeTheSky(MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ)) && rand.nextFloat() * 30F < (f - 0.4F) * 2.0F)
{
setFire(8);
}
}
super.onLivingUpdate();
}
protected int getDropItemId()
{
return Item.appleGold.shiftedIndex;
}
public int getMaxHealth()
{
return 12;
}
public EnumCreatureAttribute func_40124_t()
{
return EnumCreatureAttribute.UNDEAD;
}
}
Any suggestions would be great! I am trying to make "DeathPig" a hostile mob. Thanks!
-MinerByTrade
Does any one know how i would go about making it so that when i right click with my tool in changes the block, no matter what the block is (except maybe bedrock...), into another ore?
And also, how do i go about putting my mod into a ZIP file? so i can upload it?
Thanks!
EDIT: nevermind about the later, i fiugured that out. Still need help with the former!
you add the spawn in ComponentVillage.class, just do a ctrl+f for "EntityVillager" and you will find the spawning function, just copy the code and replace the EntityVillager and entityvillager and your entitynames.
you can't change the spawn rates though.
hope this helps.
Ty.
EDIT:
It didn't work, here's my code
protected void spawnTraders(World world, StructureBoundingBox structureboundingbox, int i, int j, int k, int l)
{
if (tradersSpawned >= l)
{
return;
}
int i1 = tradersSpawned;
do
{
if (i1 >= l)
{
break;
}
int j1 = getXWithOffset(i + i1, k);
int k1 = getYWithOffset(j);
int l1 = getZWithOffset(i + i1, k);
if (!structureboundingbox.isVecInside(j1, k1, l1))
{
break;
}
tradersSpawned++;
EntityTrader entitytraders = new EntityTrader(world);
entitytraders.setLocationAndAngles((double)j1 + 0.5D, k1, (double)l1 + 0.5D, 0.0F, 0.0F);
world.spawnEntityInWorld(entitytraders);
i1++;
}
while (true);
}
I had to remove
getVillagerType(i1));
Because i gave me an error.
Oh and if you know how to make the mob immortal (so when you attack the mob it doesnt get hurt and jump bakwards and it doesn't die) I would be very grateful
java.lang.Exception: net.minecraft.src.BlockOrithium@68302e67 is missing name tag!
at net.minecraft.src.ModLoader.AddName(ModLoader.java:291)
at net.minecraft.src.mod_Orithium.<init>(mod_Orithium.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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(Thread.java:662)
java.lang.Exception: net.minecraft.src.BlockOrithium@68302e67 is missing name tag!
at net.minecraft.src.ModLoader.AddName(ModLoader.java:291)
at net.minecraft.src.mod_Orithium.<init>(mod_Orithium.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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(Thread.java:662)
messages
Java
Edit: i fixed it
Actually. the way I fixed it was very easy. You just had to add to the first few lines of the mod_insertnamehere.class . And I fixed the dropping problem by making it extend Entity instead of EntityBoat, and changing other stuff around, as when i extended EntityBoat it took on the drop method of the Boat as well.
Thanks for that but i have another question, now when i do "map.put(net.minecraft.src.Entity****.class(etc.. etc..) "map" is underlined and says it cannot be resolved so my question is, has that changed now in 1.1 too? :huh.gif:
No, see thats the thing, i already know to do those things but there is no option to import it and when i type it in manually it still is incorrect and ive refreshed eclipse and everything which was why i was wondering "map" was changed to somthing else like "world.entityJoinedWorld" changed to "world.spawnEntityInWorld".
EDIT: Its because im stupid and forgot to put on top of that "public void AddRenderer(Map map) {" :dry.gif:
Everything is the same as in my tutorial, I didn't have to replace any spawning code for my blockium monster. There is a source code download I just updated yesterday if you want to compare the code.
ENTIY****
{
public Entity****(World world)
{
super(world);
}
public Entity****(World world, EntityLiving entityliving)
{
super(world, entityliving);
}
public Entity****(World world, double d, double d1, double d2)
{
super(world, d, d1, d2);
}
protected void func_40078_a(MovingObjectPosition movingobjectposition)
{
if(movingobjectposition.entityHit != null)
{
byte byte0 = 0;
if(!movingobjectposition.entityHit.attackEntityFrom(DamageSource.cactus, byte0));
this.explode();
}
for(int i = 0; i < 8; i++)
{
}
if(!worldObj.multiplayerWorld)
{
this.explode();
setEntityDead();
}
}
private void explode()
{
float f = 4F;
worldObj.createExplosion(null, posX, posY, posZ, f);
}
i had to add this code part for some reason ->@Override
protected void onThrowableCollision(MovingObjectPosition movingobjectposition) {
// TODO Auto-generated method stub <-
}
}
ITEM****
// Referenced classes of package net.minecraft.src:
// Item, EntityPlayer, PlayerCapabilities, ItemStack,
// World, EntitySnowball
public class Item**** extends Item
{
public Item****(int i)
{
super(i);
maxStackSize = 1;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if(!entityplayer.capabilities.depleteBuckets)
{
itemstack.stackSize--;
}
world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if(!world.multiplayerWorld)
{
world.spawnEntityInWorld(new Entity****(world, entityplayer));
}
return itemstack;
}
}
MOD_****
public class mod_**** extends BaseMod
{
// DECLARE ITEMS
public static Item ****;
// DECLARE BLOCKS
//DECLARE OTHER
public mod_****()
{
// BOMB PROPERITIES
**** = (new Item****(ModLoader.getUniqueEntityId())).setItemName("****");
ModLoader.RegisterEntityID(net.minecraft.src.Entity****.class, "Bomb", ModLoader.getUniqueEntityId());
****.iconIndex = ModLoader.addOverride("/gui/items.png", "/****.png");
ModLoader.AddName(****, "****");
ModLoader.AddRecipe(new ItemStack(****, 1), new Object[] {
"X",Character.valueOf('X'), Block.dirt
});
}
public void load(){};
public String getVersion()
{
return "1.1.0";
}
}
Can someone tell me plz how i make my mob only spawn in the villages
Ty in advance
My EntityEndermanMan.java code.
public abstract class EntityEndermanMan extends EntityMob
{
public EntityEndermanMan(World world)
{
super(world);
//Set the texture
texture = "/EndermanMan.png";
//Set the size of the hitbox
setSize(1.3F,1.3F);
//Set the speed of the mob
//NOTE: 0 = 0% speed, 1 = 100%, 0.75 = 75%
moveSpeed = 20F;
//Set how much health the mob has
health = 50;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
//Need audiomod for the next 3. Remove them if you want a silent mob (except for the sound of foot steps)
//You can also go into the entity files for other mobs and take their sounds if you want (the way I did in the video)
protected String getLivingSound()
{
//This is what sound the mob makes when living
return "mob.endermen.idle";
}
protected String getHurtSound()
{
//This is what sound the mob makes when getting hurt
return "mob.enderman.hit";
}
protected String getDeathSound()
{
//This is what sound the mob makes when dying
return "mob.endermen.death";
}
//Here's where you change the volume of the mob's sounds
protected float getSoundVolume()
{
return 0.4F;
}
//Here you define what items or blocks you want the mob to drop when killed
protected int getDropItemId()
{
return Item.enderPearl.shiftedIndex;
}
}
import java.util.Random;
import java.util.Map;
public abstract class mod_EndermanMan extends BaseMod
{
public mod_EndermanMan()
{
AddMobs();
}
public void AddMobs()
{
//This line just registers the mob, and sets a name for it, as well as it's own unique entity ID
ModLoader.RegisterEntityID(EntityEndermanMan.class, "Ender-Steve", ModLoader.getUniqueEntityId());
//This line makes tells the mob to spawn. The number 500 is how rare the mob is
//EnumCreatureType.creature = land mob, EnumCreatureType.waterCreature = water mob,
//EnumCreatureType.monster = a hostile mob that only spawns in darkness
ModLoader.AddSpawn(EntityEndermanMan.class, 1,1,1, EnumCreatureType.monster);
}
public void AddRenderer(Map map)
{
map.put(EntityEndermanMan.class, new RenderEndermanMan(new ModelEndermanMan(), 0.5F));
}
public String Version()
{
return "EndermanMan v1";
}
}
public class ModelEndermanMan extends ModelBiped
{
public ModelEndermanMan()
{
super(1, 0.0F);
}
}
import org.lwjgl.opengl.GL11;
public class RenderEndermanMan extends RenderLiving
{
//The three numbers below change the size of your model (you'll need to change the hitbox size too though)
protected void preRenderScale(EntityEndermanMan entity, float f)
{
GL11.glScalef(1F, 1F, 1F);
}
public RenderEndermanMan(ModelEndermanMan modelbase, float f)
{
super(modelbase, f);
}
public void func_177_a(EntityEndermanMan entity, double d, double d1, double d2,
float f, float f1)
{
super.doRenderLiving(entity, d, d1, d2, f, f1);
}
public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2,
float f, float f1)
{
super.doRenderLiving((EntityEndermanMan) entityliving, d, d1, d2, f, f1);
}
public void doRender(Entity entity, double d, double d1, double d2,
float f, float f1)
{
doRenderLiving((EntityEndermanMan)entity, d, d1, d2, f, f1);
}
protected void preRenderCallback(EntityLiving entityliving, float f)
{
preRenderScale((EntityEndermanMan)entityliving, f);
}
}
import java.util.Random;
//
//
//
public class ItemEndermanPearl extends Item
{
public ItemEndermanPearl(int i)
{
super(i);
maxStackSize = 16;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if(entityplayer.capabilities.depleteBuckets)
{
return itemstack;
}
itemstack.stackSize--;
world.playSoundAtEntity(entityplayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if(!world.multiplayerWorld)
{
world.spawnEntityInWorld(new EntityEnderPearl(world, entityplayer));
}
return itemstack;
}
}
package net.minecraft.src;
import java.util.Random;
public class mod_EndermanPearl extends BaseMod{
public mod_EndermanPearl()
{
//TODO List
addNames();
setTextures();
registerBlocks();
addRecipes();
addSmelting();
}
public void addNames()
{
ModLoader.AddName(EndermanPearl, "Enderman Pearl");
}
public void setTextures()
{
EndermanPearl.iconIndex = ModLoader.addOverride("/gui/items.png", "/EndermanPearl.png");
}
public void registerBlocks()
{
}
public void addRecipes()
{
}
public void addSmelting()
{
}
public static Item EndermanPearl;
static
{
EndermanPearl = (new ItemEndermanPearl(1000)).setItemName("Enderman Pearl");
}
public String getVersion()
{
return "EndermanPearl v1";
}
public void load()
{
}
}
You can not use this code.
This is how Ive set it up so far
But what happens is tht occasionally the cobble drops two blocks hwen mined, and other times it doesnt drop stone when a different item is dropped.
Im trying to just have it be a simple boolean. If the block drops something other than cobble, it becomes false. The flase boolean triggers the event of a cobble dropping.
Why isnt it working properly?
id also like to know how to make a multi-function tool(that mabey switches textures(flips) when, for example, mining or cutting wood), and how to make a recipe repair a tool thats in the crafting grid(like a pickaxe with some iron repairs it a little, or comletely)
Errors:
its coming from soda...
ItemSoda.java
you add the spawn in ComponentVillage.class, just do a ctrl+f for "EntityVillager" and you will find the spawning function, just copy the code and replace the EntityVillager and entityvillager and your entitynames.
you can't change the spawn rates though.
hope this helps.
Here is my CrashLog.
Here is my mod_DeathPig:
Any suggestions would be great! I am trying to make "DeathPig" a hostile mob. Thanks!
-MinerByTrade
And also, how do i go about putting my mod into a ZIP file? so i can upload it?
Thanks!
EDIT: nevermind about the later, i fiugured that out. Still need help with the former!
http://www.minecraftforum.net/topic/751830-110-craftite-v1/
Ty.
EDIT:
It didn't work, here's my code
I had to remove
Oh and if you know how to make the mob immortal (so when you attack the mob it doesnt get hurt and jump bakwards and it doesn't die) I would be very grateful
ahhhh its pretty good for your first mod! keep it up! I too almost released my first mod.. until ALL of my files got deleted. :sad.gif:
at net.minecraft.src.ModLoader.AddName(ModLoader.java:291)
at net.minecraft.src.mod_Orithium.<init>(mod_Orithium.java:12)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
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(Thread.java:662)
Did every thing you told me to do ill ad my mod txt in a paste bin thing! http://pastebin.com/EeVaUWT1
Umm line 12 of your mod_ class, try to download the source code and compare it to yours. I've never seen that.