Jump to content

Grim1ight

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Grim1ight

  1. Hi! Before i modded only on 1.7.10, what minecraft version to choose now?
  2. Hello! For example I want make mana system. What better to use - NBT Tags or IExtendedEntityProperities? First is much easier, but is second better? Thanks.
  3. I don't sure that code is needed because this happens even if I use this code: public class EntityGargoyle extends EntityMob { public EntityGargoyle(World p_i1694_1_) { super(p_i1694_1_); this.setSize(0.8F, 2F); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(7, new EntityAIWander(this, 1.0D)); this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false)); } public boolean isAIEnabled() { return true; } } I copied tasks from zombie class. Mob still lagging. He can't find path to target and when he falls in hole with 1 block height he just rotating on one point.
  4. Hi! I have problem with entity's AI: if isAIEnabled() returning true my mob is "lagging" - if I higher he begins shake head in different sides, if I set block before him, he jumps only after few seconds, when I changing my direction, he changes it after few seconds and moves in old direction some time. It's not critical but annoying, and happens only if I enable AI. Thanks.
  5. Capable? I think yes. I don't know Java much but I think enought for forge and I still studying. I started to making mods recently (few month ago). I usually trying to find tutorials or see Minecraft code to make basic code and then making my own stuff. If I will learn how to do something (Inventory slots for example), I will know how to make it further. And that's why I asking tutorial (now I want learn inventory, containers, GUIs). P.S. I want slot inside player inventory.
  6. Capable? I think yes. I don't know Java much but I think enought for forge and I still studying. I started to making mods recently (few month ago). I usually trying to find tutorials or see Minecraft code to make basic code and then making my own stuff. If I will learn how to do something (Inventory slots for example), I will know how to make it further. And that's why I asking tutorial (now I want learn inventory, containers, GUIs). P.S. I want slot inside player inventory.
  7. Hi! Can someone give me tutorial how to create inventory slot for 1.7.10? I used Google but dont found anything. Thanks.
  8. Hi! Can someone give me tutorial how to create inventory slot for 1.7.10? I used Google but dont found anything. Thanks.
  9. Can I hide item name over toolbar when his NBT tag changed?
  10. Ok, my bad, i added nbt tags and now all working Thanks!
  11. Hi! I need to make delay before attack, this is my code: private int attackDelay; private int attackTimer; private Entity attackedEntity = null; public ItemGreatsword(Item.ToolMaterial par1ToolMaterial, int par2AttackDelay) { this.field_150933_b = par1ToolMaterial; this.maxStackSize = 1; this.setMaxDamage(par1ToolMaterial.getMaxUses()); this.setCreativeTab(CreativeTabs.tabCombat); this.field_150934_a = 4.0F + par1ToolMaterial.getDamageVsEntity(); //this.attackDelay = par2AttackDelay; this.attackDelay = 40; } @Override public boolean onLeftClickEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, Entity par3Entity) { if (attackedEntity == null) { this.attackTimer = (this.attackDelay + 1); this.attackedEntity = par3Entity; } return true; } @Override public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { super.onUpdate(par1ItemStack, par2World, par3Entity, par4, par5); EntityPlayer player = (EntityPlayer)par3Entity; ItemStack equippedItem = player.getCurrentEquippedItem(); if (this.attackTimer > 0) { --this.attackTimer; System.out.println("AttackTimer: " + this.attackTimer); } if (this.attackTimer == 1) { if (!par2World.isRemote) { this.attackedEntity.attackEntityFrom(DamageSource.lava, 6.0F); this.attackedEntity = null; this.attackTimer = 0; System.out.println("Test"); } } if (equippedItem == par1ItemStack) { player.addPotionEffect(new PotionEffect(Potion.digSlowdown.getId(), 0, 3)); } } Part of code (System.out.println("Test")) working, entity != null too, i checked it, but entity wont die. Thanks.
  12. Hi. I made config with entity class names list. All working fine except checking: String[] mob = Config.entityList.split(","); String[] mobNames = new String[mob.length]; for(int i = 0; i < mob.length; i++) { mobNames[i] = mob[i]; } for (int i = 0; i < mobNames.length; i++) { if (event.entity.class.getSimpleName() == mobNames[i]) { // } else { System.out.println(event.entity.class.getSimpleName() + " --- "+ mobNames[i]); } } I getting it: "EntityZombie --- EntityZombie" Wt..?
  13. Hi! I made a mob model and want to make animations. Every leg have 2 pieces: upper and lower. Parts of code: convertToChild(leftleg, leftleg2); convertToChild(rightleg, rightleg2); this.leftleg.rotateAngleX = -1.3F * this.func_78172_a(f, 9.0F) * f1; this.rightleg.rotateAngleX = 1.3F * this.func_78172_a(f, 9.0F) * f1; this.leftleg.rotateAngleY = 0.0F; this.rightleg.rotateAngleY = 0.0F; protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) { parChild.rotationPointX -= parParent.rotationPointX; parChild.rotationPointY -= parParent.rotationPointY; parChild.rotationPointZ -= parParent.rotationPointZ; parChild.rotateAngleX -= parParent.rotateAngleX; parChild.rotateAngleY -= parParent.rotateAngleY; parChild.rotateAngleZ -= parParent.rotateAngleZ; parParent.addChild(parChild); } Problem is that upper and lower pieces moving in other directions.
  14. I solved problem with a sending a packet from server to client (SimpleNetworkWrapper). Very big thanks to Choonster for helping!
  15. Srsly? It's part of code! I have this in main class: @EventHandler public void Load(FMLInitializationEvent Event) { MinecraftForge.EVENT_BUS.register(new *EventName*()); } + Smth like this: @SubscribeEvent public void onLivingAttackEvent(LivingAttackEvent event) { if (event.ammount > 0 && event.source != DamageSource.lava && event.source != DamageSource.inFire && event.source != DamageSource.cactus && event.source != DamageSource.wither && event.source != DamageSource.magic) { TheEvent bEvent = new TheEvent(event.entityLiving); } }
  16. It's a part of code All working on clientside with mobs, with players (btw with npcs in mod CustomNPC) in serverside, but then crashing with Ticking Entity/Player error. if ()
  17. Hi! I have problem with LivingEvent: When I'm trying to spawn particles near player inside worldObj.isRemote it's isnt working, when I'm using it outside it's work but then crash with TickingPlayer/TickingEntity error. Here's code: public Event(EntityLivingBase par1Entity) { super(par1Entity); double f1 = entity.posX; double f2 = entity.posY + 1; double f3 = entity.posZ; if (entity.worldObj.isRemote) { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)entity; spawnParticles(player, 300); //It's not working } } else { if (entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer)entity; spawnParticles(player, 300); //It's working with crash after second } } } void spawnParticles(EntityLivingBase par1entity, int par2Value) { spawnP(par1entity, Blocks.RedBlock, 0, 1, 2, par2Value); } void spawnP(EntityLivingBase par1entity, Block par2Block, int par3Meta, int par4Meta, int par5Meta, int par6Value) { float f1 = (float)(par1entity.posX); float f2 = (float)(par1entity.posY + 1F); float f3 = (float)(par1entity.posZ); for(int i = 0; i < par6Value; i++) { int x = new Random().nextInt(3); if (x == 0 ) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityRedParticleFX(par1entity.worldObj, f1, f2, f3, 0.0D, 0.0D, 0.0D, par2Block, par3Meta)); else if (x == 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityRedParticleFX(par1entity.worldObj, f1, f2, f3, 0.0D, 0.0D, 0.0D, par2Block, par4Meta)); else if (x == 2) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityRedParticleFX(par1entity.worldObj, f1, f2, f3, 0.0D, 0.0D, 0.0D, par2Block, par5Meta)); } }
  18. Ok, i used code from EntityDiggingFX, now it's wirking fine! But when i used it before it's was crashing. P.S. Tuts that i found in google for older versions and/or crashing for me.
  19. Hi all! Can somebody give a simple particle code? And how to make particle like blocks break (default it just fall down). Thanks.
  20. Hello! I have 2 questions: 1. Can I increace vanilla particle max age? 2. How to spawn particles of my block breaking? (For vanilla blocks it "blockcrack_id_meta")
  21. Thx, but I'm had already got help. I rendered it with bindTexture and ItemRenderer.renderItemIn2D.
  22. Hello. I want to render texture of my item - to scale up. I know 3D renderer, but don't know 2D. How to render my sword texture? I saw it in CustomNPC mod and think it possible.
×
×
  • Create New...

Important Information

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