Jump to content

Thornack

Members
  • Posts

    629
  • Joined

  • Last visited

Everything posted by Thornack

  1. Ya the whole no animations support thing for .obj seems to be an issue. I wonder if there is a way around it. I think the developer of Pixelmon has found a way to do it but other than that I dont think many people have.
  2. I have several Blender models which I wish to make into mobs, What are the requirements to code in the .obj files so they appear in game as mobs? I know how to do it using techne models (this is easy) but i am stumped by how to take a Blender model and code it in game. Are there tutorials for this?
  3. I have found the following AxisAlignedBB axisalignedbb = AxisAlignedBB.getAABBPool().getAABB((double)xCoord, (double)yCoord, (double)zCoord, (double)(xCoord + 1), (double)(yCoord + 1), (double)(zCoord + 1)).expand(1, 1, 1); List list = worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb); Iterator iterator = list.iterator(); Entity ent; while (iterator.hasNext()){ ent = (Entity) iterator.next(); if(!(ent instanceof EntityLivingBase)){ (EntityLivingBase) ent).setDead(); } } but cant seem to get it to work any ideas?
  4. I have been trying for weeks to add functionality to my mob spawner which would run a check on a specific in game tick for all objects (mobs) within a specific radius and then if this check finds that the mobs exist it despawns them. I have been very unsuccessful. Currently I have a tile entity which I created called mobspawner and it has a working timer which is synced with the minecraft in game ticks. This mob spawner has the functionality to spawn mobs at a specific game time and does so forever. This is a problem since it eventually crashes the game due to too many entities being present. does anyone know of a way to implement such functionality? Any help is very much appreciated.
  5. I have a Tile entity which is synced up with a timer and spawns a mob at specific times. I wish to add functionality to despawn the mob in question at a different specific time within a certain radius of the tile entity. How can I use the setDead method to do this?
  6. how did you define your setDead() method
  7. Would anyone know any functions built into the Forge API which control when a mob despawns in minecraft? (the function that causes night mobs to despawn during the day etc..) I have a bunch of custom mobs and am attempting to figure out how to have the mobs spawn for a specific amount of world time, where after the allotted world time has passed use some sort of if then statement to access a function which would cause the mobs to despawn from the world. Any ideas?
  8. Hi, I have a mob coded in and want to give it a stat called obedience. It would have a value that is affected by how you treat your mob (example give it an apple increases obedience by 1, hitting your mob decreases its obedience by its loss in health or whatever.) I want this stat to directly affect whether it will obey my command (im just trying the sit function that a wolf uses atm). So I wish to accomplish this by using a weighted probability and upon implementing the sit command activating the weighted probability which would return a value lets say 1% of the time that allows the sit function to be implemented (I know how to do this part mostly). But I want to affect the 1% chance of returning the desired value, directly using the value of the obedience stat. so the higher the stat would be the higher the chance of returning the desired value which would then allow for the mob to sit. Anyone have any ideas on how to do this logic wise in java.
  9. I have figured it out and it was just me being stupid. The following worked public class TileEntitySpawn extends TileEntity { private int timer; public TileEntitySpawn(){ timer = 100; } @Override public void updateEntity() { if (timer == 0 && !worldObj.isRemote) { timespawner(worldObj, xCoord +1, yCoord +2, zCoord +1, null); timer = 100; } timer--; } public static void timespawner(World par1World, int i, int j, int k, Entity par5Entity) { EntityCustomMob CustomMob = new EntityCustomMob(par1World); CustomMob.setLocationAndAngles(i, j, k, 0.0F, 0.0F); par1World.spawnEntityInWorld(CustomMob); } } I do have another question though, which function would I use to synchronize my timer with the world time
  10. I know about the timer--; part and I have gotten the timer to work properly and count down (if you use ++ it counts up) for example. My issue is using this to call up a method to spawn my mob. timer--; I have found that worldObj.spawnEntityInWorld(ent); doesnt seem to work, and Im not sure why. Ive been trying to figure out how vanilla spawner work with no success yet. I havent been able to find the function that defines which mob spawns or the function that actually spawns them. Ive found the functions that define the spawn delay and radius but im stuck on this one.
  11. I have a bunch of mobs that spawn correctly using spawn eggs but I dont know how to use the tile entity in place of the spawn egg
  12. //How would I use a Tile Entity to spawn one of my custom mobs after x amount of ticks? //I have a block class called spawn.java that extends BlockContainer and a tile entity functionality added to it. public class TileEntitySpawn extends TileEntity [ private int timer; public TileEntitySpawn(){ timer = 100; } @Override public void updateEntity() { if timer ==0 && !worldObj.isRemote){ } } } //I wish to use public void onEntityWalking(World par1World, int i, int j, int k, Entity par5Entity {} //I know you have to use EntityLiving ent = (EntityLiving)EntityList.createEntityByName("",par1World) ent.setLocationAndAngles(i, j+1, k, 0F, 0F); // but im not sure how to actually get it to spawn this is where I got stuck. Any help would be appreciated. I kind of want to make a custom mob spawner for 1.5.2 but with the walk on functionality added
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.