again it seems that i found the problem, probably you can have a neat idea/work around on this,
1.) As I have been through this problem for 5 days now, as stated in my previous post. 1.a.) I copied the entire code of Entitywolf over to my entitymob knowing that this might give me the behavior that i wanted.
1.b.) To my surprise the wolf behavior for taming was carried over but the attacking behavior wasn't 1.b.1) The attacking behavior that I wanted was my mob should attack anything that i also strike. My mob does strike evil mobs(EntityMob) which is a built in function I added to it but it doesnt attack animals when I attack it like the tamed wolf does.
2.) So this lead me to a conclusion that the method needed for this behavior is not in EntityWolf but somewhere else. 2.1.) So i ask for help from mr. Inlanoche and he told me to go to EntityPlayer and indeed i found the method i was looking for.
This means that this method can't be edited for the soul reason that it is a main minecraft class. Could there be a way to call this for a custom mob. I think there is a possibility but it may be tricky as you said.
again it seems that i found the problem, probably you can have a neat idea/work around on this,
1.) As I have been through this problem for 5 days now, as stated in my previous post. 1.a.) I copied the entire code of Entitywolf over to my entitymob knowing that this might give me the behavior that i wanted.
1.b.) To my surprise the wolf behavior for taming was carried over but the attacking behavior wasn't 1.b.1) The attacking behavior that I wanted was my mob should attack anything that i also strike. My mob does strike evil mobs(EntityMob) which is a built in function I added to it but it doesnt attack animals when I attack it like the tamed wolf does.
2.) So this lead me to a conclusion that the method needed for this behavior is not in EntityWolf but somewhere else. 2.1.) So i ask for help from mr. Inlanoche and he told me to go to EntityPlayer and indeed i found the method i was looking for.
This means that this method can't be edited for the soul reason that it is a main minecraft class. Could there be a way to call this for a custom mob. I think there is a possibility but it may be tricky as you said.
THis is all i currently able to dig about.
OOORRRRR
you could just make it extend entityWolf xD
should of thought of that a long time ago :tongue.gif:
Rollback Post to RevisionRollBack
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
you should be able to understand this after the block code
next part! and last part!
public static Item cheese = (new ItemFood(3068, 10, true)).setItemName("healthpotion");
like the block properties, but its item properties instead
and, the part after ItemFood, this (3068, 10, true))
true makes it feed-able to wolves the 10 sets its healing power, and 3068 is the ID
now, the part where it says, new ItemFood sets it to be a food, if you dont want it to be food just use this code
public static Item cheese = (new ItemCheese(3031)).setItemName("cheese");
ok, you've done half of it!
now for the
ItemCheese!
package net.minecraft.src;
public class ItemHealthpotion extends ItemFood
{
public ItemHealthpotion(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = 64;
}
}
really, this is the easiest code ever
all to tell you is maxStackSize = 64;
is the max stack size, thats all
again, if you dont want it to be a food, change this
public class ItemHealthpotion extends ItemFood
to this!
public class ItemHealthpotion extends Item
ok, here are all the codes,
mod_***
package net.minecraft.src;
import java.util.Random;
public class mod_Tankite extends BaseMod
{
public mod_Tankite()
{
ModLoader.RegisterBlock(cow);
ModLoader.AddName(tankite, "Tankite");
ModLoader.AddRecipe(new ItemStack(tankite, 1), new Object[] {
"XX", "XX", Character.valueOf('X'), Block.dirt
});
ModLoader.AddRecipe(new ItemStack(cheese, 1), new Object[] {
"XX", Character.valueOf('X'), Block.dirt
});
public String Version()
{
return "1.7.3 Items, Blocks";
}
public static Block tankite = (new BlockTankite(211, ModLoader.addOverride("/terrain.png", "/Tankite.png"))).setHardness(1F).setLightValue(1.0F).setResistance(5000F).setBlockName("tankite");
public static Item cheese = (new ItemFood(3068, 10, true)).setItemName("cheese");
}
ItemCheese
package net.minecraft.src;
public class ItemHealthpotion extends ItemFood
{
public ItemHealthpotion(int i, int j, boolean flag, int k)
{
super(i, j, flag);
maxStackSize = 64;
}
}
and that's just for the pickaxe. You also have it organized WAY wrong and you need to add a public mod_GT() in there. The errors with the recipes is probably because at the end of it you put a bracket instead of parentheses. Here's what it should look like:
package net.minecraft.src;
public class mod_GT extends BaseMod{
public mod_GT()
{
glasspickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glasspickaxe.png");
glasshoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glasshoe.png");
glassshovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/glassshovel.png");
glassaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glassaxe.png");
ModLoader.AddName(glasspickaxe, "Glass Pickaxe");
ModLoader.AddName(glasshoe, "Glass Hoe");
ModLoader.AddName(glassshovel, "Glass Shovel");
ModLoader.AddName(glassaxe, "Glass Axe");
ModLoader.AddRecipe(new ItemStack(glasspickaxe, 1), new Object[] {
"XXX", " # ", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(glasshoe, 1), new Object[] {
" XX", " # ", " # ", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
Modloader.AddRecipe(new ItemStack(glassshovel, 1), new Object [] {
"X", "#", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
Modloader.AddRecipe(new ItemStack(glassaxe, 1)), new Object [] {
"XX", "#X", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
}
public static Item glasspickaxe = (new ItemPickaxe(170, EnumToolMaterial.GLASS)).setItemName("glasspickaxe");
public static Item glasshoe = (new ItemHoe(171, EnumToolMaterial.GLASS)).setItemName("glasshoe");
public static Item glassshovel = (new ItemSpade(172, EnumToolMaterial.GLASS)).setItemName("glassshovel");
public static Item glassaxe = (new ItemAxe(173, EnumToolMaterial.GLASS)).setItemName("glassaxe");
public String Version()
{
return "1.7.3";
}
}
Rollback Post to RevisionRollBack
FRIENDLY REMINDER: If my post has helped you in any way, be sure to click the littlebutton in the bottom right.
and that's just for the pickaxe. You also have it organized WAY wrong and you need to add a public mod_GT() in there. The errors with the recipes is probably because at the end of it you put a bracket instead of parentheses. Here's what it should look like:
package net.minecraft.src;
public class mod_GT extends BaseMod{
public mod_GT()
{
glasspickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glasspickaxe.png");
glasshoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glasshoe.png");
glassshovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/glassshovel.png");
glassaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/glassaxe.png");
ModLoader.AddName(glasspickaxe, "Glass Pickaxe");
ModLoader.AddName(glasshoe, "Glass Hoe");
ModLoader.AddName(glassshovel, "Glass Shovel");
ModLoader.AddName(glassaxe, "Glass Axe");
ModLoader.AddRecipe(new ItemStack(glasspickaxe, 1), new Object[] {
"XXX", " # ", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
ModLoader.AddRecipe(new ItemStack(glasshoe, 1), new Object[] {
" XX", " # ", " # ", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
Modloader.AddRecipe(new ItemStack(glassshovel, 1), new Object [] {
"X", "#", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
Modloader.AddRecipe(new ItemStack(glassaxe, 1)), new Object [] {
"XX", "#X", "#", Character.valueOf('X'), Block.glass, Character.valueOf('#'), Item.stick
});
}
public static Item glasspickaxe = (new ItemPickaxe(170, EnumToolMaterial.GLASS)).setItemName("glasspickaxe");
public static Item glasshoe = (new ItemHoe(171, EnumToolMaterial.GLASS)).setItemName("glasshoe");
public static Item glassshovel = (new ItemSpade(172, EnumToolMaterial.GLASS)).setItemName("glassshovel");
public static Item glassaxe = (new ItemAxe(173, EnumToolMaterial.GLASS)).setItemName("glassaxe");
public String Version()
{
return "1.7.3";
}
}
Hello, I would like to thank you for putting up a generation tutorial, but I am having a bit of trouble. I keep getting an error that shuts down really quickly. I can't even see what the error says it shuts down so quickly. Here is my code:
package net.minecraft.src;
import java.util.Random;
public class mod_RedBerry extends BaseMod{
public mod_RedBerry(){
ModLoader.AddName(redBerry, "Red Berry");
}
public static final Item redBerry;
static{
redBerry = new ItemFood(200, 5, false).setIconIndex(ModLoader.addOverride("/gui/items.png", "/fieldz/RedBerry.png")).setItemName("redBerry");
}
public static final Block redBerryBush;
static{
redBerryBush = new Block(101, ModLoader.addOverride("/terrain.png", "/fieldz/RedBerryBush.png"), Material.leaves).setHardness(0.5F).setResistance(2.0F).setBlockName("redBerryBush");
}
public void GenerateSurface(World world, Random random, int i, int j){
for(int k = 0; k <0.1; k++){
int RandPosX = i + random.nextInt(16);
int RandPosY = random.nextInt(128);
int RandPosZ = j + random.nextInt(16);
(new WorldGenT()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
}
public String Version() {
return "v0.1";
}
}
package net.minecraft.src;
public class ItemRedBerry extends Item{
private int healAmount;
protected ItemRedBerry(int i, int j) {
super(i);
healAmount = j;
maxStackSize = 4;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer){
itemstack.stackSize--;
entityplayer.heal(healAmount);
return itemstack;
}
}
package net.minecraft.src;
import java.util.Random;
public class BlockRedBerryBush extends Block{
Random random;
protected BlockRedBerryBush(int i, int j){
super(i, j, Material.leaves);
}
public int idDropped(int i, Random random) {
return mod_RedBerry.redBerry.shiftedIndex;
}
public int quantityDropped(Random random){
return random.nextInt(2);
}
}
package net.minecraft.src;
import java.util.Random;
public class WorldGenT extends WorldGenerator{
public WorldGenT(){
}
public boolean generate(World world, Random random, int i, int j, int k) {
for(int l = 0; l < 64; l++)
{
int i1 = (i + random.nextInt(8)) - random.nextInt(8);
int j1 = (j + random.nextInt(4)) - random.nextInt(4);
int k1 = (k + random.nextInt(8)) - random.nextInt(8);
if(world.isAirBlock(i1, j1, k1) && ((BlockFlower)mod_RedBerry.redBerryBush).canBlockStay(world, i1, j1, k1))
{
world.setBlock(i1, j1, k1, mod_RedBerry.redBerryBush.blockID);
}
}
return true;
}
}
Yeah, I sorta copy pasted your gen code just to see if I could get it to load up. Just temporary.
hey madgoblin, recognize any of these errors? This is when I try to run startclient.bat. When I use actual minecraft it doesn't work either though.
== MCP v4.3 ==
[10:09] java.lang.NoClassDefFoundError: Start
[10:09] Caused by: java.lang.ClassNotFoundException: Start
[10:09] at java.net.URLClassLoader$1.run(Unknown Source)
[10:09] at java.security.AccessController.doPrivileged(Native Method)
[10:09] at java.net.URLClassLoader.findClass(Unknown Source)
[10:09] at java.lang.ClassLoader.loadClass(Unknown Source)
[10:09] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
[10:09] at java.lang.ClassLoader.loadClass(Unknown Source)
[10:09] Could not find the main class: Start. Program will exit.
[10:09] Exception in thread "main"
java.lang.NoClassDefFoundError: Start
Caused by: java.lang.ClassNotFoundException: Start
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: Start. Program will exit.
Exception in thread "main"
Press any key to continue . . .
Rollback Post to RevisionRollBack
FRIENDLY REMINDER: If my post has helped you in any way, be sure to click the littlebutton in the bottom right.
Yep i indeed have a modloader compatible entity file
All set-up
mod_mob.java
Entitymob.java
Modelmob.java
Rendermob.java
And the behavior thing that i wanted to add to my custom mob, i had been inserting into my entity class.
my only problem is i couldn't find the right way of coding this behavioral pattern
1. My tamed mob would attack any EntityLiving that i also attack (exactly like how a tamed wolf behaves)
I already accomplish
1. Taming It
2. Coding for its movement
3. Spawning percentage
4. Modeling and all
My only problem is the one mentioned above.
Thank you again good sir! For the help and response :smile.gif:
link: The Dragon Ball Mod Alpha 1.1
did you extend it to the same entity wolf extends? i think it extends entity animal :tongue.gif:
ive almost got it ready, another few days and it should be there
hmm, maybe with the damage you could do, this...
oh wait, that would only kill the player... try and use something like that though
i will put it up on the tutorial
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
when i remember how to do it, which might take a while :S
some new info, the wheat tutorial is not going to come out for a while, i checked out blockcrops and, its really complex...
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
link: The Dragon Ball Mod Alpha 1.1
well, its tricky :tongue.gif:
i will make a tutorial on it though..
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
again it seems that i found the problem, probably you can have a neat idea/work around on this,
1.) As I have been through this problem for 5 days now, as stated in my previous post.
1.a.) I copied the entire code of Entitywolf over to my entitymob knowing that this might give me the behavior that i wanted.
1.b.) To my surprise the wolf behavior for taming was carried over but the attacking behavior wasn't
1.b.1) The attacking behavior that I wanted was my mob should attack anything that i also strike. My mob does strike evil mobs(EntityMob) which is a built in function I added to it but it doesnt attack animals when I attack it like the tamed wolf does.
2.) So this lead me to a conclusion that the method needed for this behavior is not in EntityWolf but somewhere else.
2.1.) So i ask for help from mr. Inlanoche and he told me to go to EntityPlayer and indeed i found the method i was looking for.
method inside entity player named alertWolves:
protected void alertWolves(EntityLiving entityliving, boolean flag)
{
if((entityliving instanceof EntityCreeper) || (entityliving instanceof EntityGhast))
{
return;
}
if(entityliving instanceof EntityWolf)
{
EntityWolf entitywolf = (EntityWolf)entityliving;
if(entitywolf.isWolfTamed() && username.equals(entitywolf.getWolfOwner()))
{
return;
}
}
if((entityliving instanceof EntityPlayer) && !func_27025_G())
{
return;
}
List list = worldObj.getEntitiesWithinAABB(net.minecraft.src.EntityWolf.class, AxisAlignedBB.getBoundingBoxFromPool(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(16D, 4D, 16D));
Iterator iterator = list.iterator();
do
{
if(!iterator.hasNext())
{
break;
}
Entity entity = (Entity)iterator.next();
EntityWolf entitywolf1 = (EntityWolf)entity;
if(entitywolf1.isWolfTamed() && entitywolf1.getTarget() == null && username.equals(entitywolf1.getWolfOwner()) && (!flag || !entitywolf1.isWolfSitting()))
{
entitywolf1.setWolfSitting(false);
entitywolf1.setTarget(entityliving);
}
} while(true);
}
This means that this method can't be edited for the soul reason that it is a main minecraft class. Could there be a way to call this for a custom mob. I think there is a possibility but it may be tricky as you said.
THis is all i currently able to dig about.
link: The Dragon Ball Mod Alpha 1.1
OOORRRRR
you could just make it extend entityWolf xD
should of thought of that a long time ago :tongue.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Spoilers dont show up :mellow.gif:
refresh the page.
when things like this happen you just have to refresh the page...
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
link: The Dragon Ball Mod Alpha 1.1
error log and .java file?
i might be able to fix...
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
i know :sad.gif:
not sure, i havn't looked into this...
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
this is really complex, but i will make one some time :biggrin.gif:
you get rid of any item. or .shiftedIndex or Block. or .blockID you just put the name..
not really modding again, but thanks, i might need your help :biggrin.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
That's actually extremely simple.You didn't name it and you didn't set the texture.
So for your glass pickaxe, you'd have to add 2 lines of code.
and that's just for the pickaxe. You also have it organized WAY wrong and you need to add a public mod_GT() in there. The errors with the recipes is probably because at the end of it you put a bracket instead of parentheses. Here's what it should look like:
thanks for helping while i was asleep guys :smile.gif:
I made this map! Please check it out! It's a really awesome map that took me over a year to make! :3
Yeah, I sorta copy pasted your gen code just to see if I could get it to load up. Just temporary.
Thinking about coming a mod to simply not moderate.