Jump to content

DoorCloser

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by DoorCloser

  1. Nope. Still spawning in one direction.
  2. What? How i suppose to do that? Please give the code if you know something about it. See the line task.addTask ? Then this exist too task.removeTask Now, how to find a player ? EntityPlayer closePlayer = this.worldObj.getClosestPlayerToEntity(this, putSomeDistanceHere); if(closePlayer==null){ //forever alone }else{ //kill the bastard } Ok, so i've made how you type and that works! So my mob shoots potion in me when he cant get me with himself. Thank you so much.
  3. Learn how to program. Sorry, modding without programming is impossible. I know the basics of java. But i without copying stuff and reading from somewhere, thats impossible to draw a code by myself. All that symbols have to be correctly put.
  4. Hi everybody . I've came back to that forum with some more questions. So basiclly thats about animations. I dont know how to make some of these facts: 1. When mob is idle, i want it to like breathing or something, so his arms slowly swinging. ModelBiped does the same thing when stays on one place. If you still dont understand what i mean, please check it out in the game. 2. Living animations. I tried to use IronGolem one's, but it didnt work. It kinda fu** up my mob. So basiclly lets just think its not working how i did that. Maybe there is any tutorials on it, could somebody give a link? That would be awesome. 3. I want my mob to jump on me. So its kinda like the slime, but my mob will have to jump like from 3 blocks distance on me. Just like a HeadCrab, if you know what i mean))) Thats probably all i need to know at the moment. If you know anything about solving those problems, please, reply here. I really need this. But if you know any tutorial on how to make these, please, reply too. It will be so appreciated. Thanks alot if you read that post. That means you want to help me)
  5. What?? Um and how i suppose to do that actually? This is so hard, hundreds of code.
  6. You need 2 AI tasks. One which throws the potions and one which performs the melee attack. The methods in the EntityAI class are pretty self explanatory to be honest. this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIWander(this, 0.2F)); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.tasks.addTask(5, new EntityAIArrowAttack(this, this.moveSpeed, 60, 10.0F)); this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 25.0F, 0, true)); Those are my Entity tasks. I think ArrowAttack and AttackOnCollide perform both attacks. But ArrowAttack is not working with AttackOnCollide. So when i use AttackOnCollide, my Entity only perform melee attacks. So ArrowAttack is just confusing and stop working. Understand? But when i remove AttackOnCollide task, ArrowAttack works fine. But my mob cant perform melee attacks. Those tasks are not working with eachother. So i dont know what to do lol.
  7. So did you understand my question and can you help me please?
  8. What? How i suppose to do that? Please give the code if you know something about it.
  9. Check out my question again. I've made my mob throwing potions, but when i set task attackOnColide to him, it only perform melee attacks on me and not throwing potions. Without that task, my mob throws potions well. I want him to perform both attacks.
  10. Hello everyone. I've got a little problem and some questions. 1.I want my mob to throw poison potions at me and melee attack me when i get close. I've looked at witch's code and i've made my mob throw potions at me. So that works, but when i use attackOnColide task on my mob, it only melee attacks me, not throwing potions. How to do so: Throw potions at me when im far from mob, or mob cant get me( im on the roof or something in this sort ), and melee attack me when i get close to it. Help me please, i really need this.
  11. GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); You mean this? I already had this. Not a solution...
  12. So if i use TileEntitySpecialRenderer extended in my TileEntityNameRenderer, then what i suppose to type and where? thx
  13. Which you are. Yes, i have that extending in my TileEntityNameRenderer file. I have to do something different?
  14. That what you mean? public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); } My TileEntity Actually looks like this. If i put that code for top, side, bottom and etc textures, it will sit correctly?
  15. Hey guys. Last time i visited this page i was a little bit rude to you guys. Sorry for that though. But now i have some more questions and problems in coding My TileEntity spawns ok, but always faced in one direction. How to make it faced to me always i put it. I tried to put that code in my BlockName file: public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving, ItemStack par6ItemStack) { int var7 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); } So my TileEntity still spawns faced in one direction, but i think i know what the problem. Block have no Textures so i dont see it changes it's facing direction. TileEntity doesnt rotate because i have to do something in TileEntity file, i guess? Could anybody help?
  16. You are correct sir. Somewhere along the way that fact slipped my mind. Only so many "textures not working" threads you can remember the exact answers to. I dont think the whole problem is in textures only. Code is really messed up. I cant find any good tutorials on 1.5.2 version or similar. I followed some minecraftforge wiki tutorials and that couldnt help too.Is there any other tutorials on how to create TileEntity block?
  17. That forum actually made to help us, to fix our problems. You're giving strange hints instead of the whole material. We are newbs in java, thats why we ask a questions here. Have you ever feel like you talking to the wall!?
  18. private static final ResourceLocation texture = ResourceLocation(mod_HalflifeMod.modid, "textures/blocks/xeniantree.png"); When i try to create TileEntityNameRenderer file, i need to set a texture to it. But when i create that string, it says modid cannot be resolved or is not a field. But i have those strings in my mod file: @Mod(modid = "hlmod", name = "Half-Life MOD", version = "v1") What i have to do? Perhps its because of version, because eclipse cnt find ResourceLocation method in net.minecraft.util. So i have to do this texture somehow different. Can you guys tell me how? pls
  19. Do you really think i understand your hints? I dont understand what i suppose to do. I've get all codes here, you havent said that something wrong with them. What is Vanilla and how i can find it in Block class. Vanilla is moded minecraft, isnt it? Where can i find a string, that defines each block? Could you explain more detailed, please.
  20. Where i suppose to add it? It cant be in mod class.
  21. You also havent uploaded the BlockName code. You've put your TileEntity code instead of it. Check your BlockName code here.
  22. I've made everything correct, i have no errors. But when i spawn my block( which supposed to be TileEntity ), it spawns only a missing texture block. I'll get codes here: BlockXenTree package doorcloser.modding; import java.util.ArrayList; import java.util.Random; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockXenTree extends Block { public static int renderType; public BlockXenTree(int par1, String texture) { super(par1, Material.ground); setCreativeTab(mod_HalflifeMod.tabxen); } public int idDropped(int i, Random random, int j) { return mod_HalflifeMod.xeniantree.blockID; } public int quantityDropped(Random random) { return 1; } public void setBlockBoundsBasedOnState(IBlockAccess iblockacess, int i, int j, int k) { setBlockBounds(0.0F, 0.0F, 0.0F, 1F, 1F, 1F); } public void getCollidingBoundingBoxes(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, ArrayList arraylist) { setBlockBounds(0.3F, 0.3F, 0.03F, 0.7F, 0.7F, 0.7F); } public boolean renderAsNormalBlock() { return false; } public boolean isOpaqueCube() { return false; } public String getTextureFIle(){ return "/textures/blocks/xeniantree.png"; } } ModelXenTree package doorcloser.modding; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.monster.EntityIronGolem; import net.minecraft.util.MathHelper; @SideOnly(Side.CLIENT) public class ModelXenTree extends ModelBase { // fields ModelRenderer main; ModelRenderer forebody; ModelRenderer clawa; ModelRenderer clawb; ModelRenderer clawc; ModelRenderer clawmain; public ModelXenTree() { textureWidth = 64; textureHeight = 128; main = new ModelRenderer(this, 0, 0); main.addBox(0F, 0F, 0F, 11, 24, 11); main.setRotationPoint(-5.5F, 0F, -4F); main.setTextureSize(64, 128); main.mirror = true; setRotation(main, 0F, 0F, 0F); forebody = new ModelRenderer(this, -1, 99); forebody.addBox(0F, 0F, 0.2F, 9, 14, 9); forebody.setRotationPoint(-4.5F, -13F, -3F); forebody.setTextureSize(64, 128); forebody.mirror = true; setRotation(forebody, -0.0743572F, 0F, 0F); clawa = new ModelRenderer(this, 0, 40); clawa.addBox(-3.5F, -9.8F, -3F, 7, 10, ; clawa.setRotationPoint(0F, -11.5F, 1F); clawa.setTextureSize(64, 128); clawa.mirror = true; setRotation(clawa, 0.2617994F, 0F, 0F); clawb = new ModelRenderer(this, 0, 63); clawb.addBox(-3F, -11F, -10F, 6, 5, 9); clawb.setRotationPoint(0F, -11.5F, 1F); clawb.setTextureSize(64, 128); clawb.mirror = true; setRotation(clawb, 0F, 0F, 0F); clawc = new ModelRenderer(this, 0, 80); clawc.addBox(-2.5F, -13F, -17F, 5, 3, 13); clawc.setRotationPoint(0F, -11.5F, 1F); clawc.setTextureSize(64, 128); clawc.mirror = true; setRotation(clawc, 0.4089647F, 0F, 0F); clawmain = new ModelRenderer(this, 39, 82); clawmain.addBox(-1F, 5.8F, -20.5F, 2, 12, 2); clawmain.setRotationPoint(0F, -11.5F, 1F); clawmain.setTextureSize(64, 128); clawmain.mirror = true; setRotation(clawmain, -0.5205006F, 0F, 0F); } 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, entity); main.render(f5); forebody.render(f5); clawa.render(f5); clawb.render(f5); clawc.render(f5); clawmain.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } } TileEntityXenTree package doorcloser.modding; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; public class TileEntityXenTree extends TileEntity { public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); } public void readFromNBT(NBTTagCompound nbt) { super.readFromNBT(nbt); } public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.customParam1); } } TileEntityXenTreeRenderer package doorcloser.modding; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TileEntityXenTreeRenderer extends TileEntitySpecialRenderer{ ModelXenTree model = new ModelXenTree(); public void renderAModelAt(TileEntityXenTree tileentity, double d, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)d + 0.5F, (float)d1 + 0.5F, (float)d2 + 0.5F); GL11.glPushMatrix(); GL11.glPopMatrix(); GL11.glPopMatrix(); } public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) { renderAModelAt((TileEntityXenTree)tileentity, d, d1, d2, f); } } My mod "piece of code" xeniantree = new BlockXenTree(2021, "xeniantree") .setUnlocalizedName("xeniantree") .setHardness(8.0F) .setResistance(4.0F) .setStepSound(Block.soundStoneFootstep); GameRegistry.registerTileEntity(doorcloser.modding.TileEntityXenTree.class, "xeniantree"); ClientRegistry.bindTileEntitySpecialRenderer(doorcloser.modding.TileEntityXenTree.class, new TileEntityXenTreeRenderer()); GameRegistry.registerBlock(xeniantree, "xeniantree"); LanguageRegistry.addName(xeniantree, "Xenian Tree"); Repeat: It only spawns a missing textured block. But i have get my textures inside of minecraft.jar. They are looking different than basic block textures(not 16 to 16 but 128 to 64). So what am i suppose to do? Help please.
  23. I want it to stand on one place. But it has to have an animations. Isnt it's suppose to be entity? Its can be a block, but with animations? Im newb at it, could you help me?
×
×
  • Create New...

Important Information

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