Jump to content

Recommended Posts

Posted

Hello I've been making a mob that is supposed to raise his arm when he is close to a target here is my code (I'm using Mcreator) :

package mod.mcreator;

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.EntityRegistry;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.client.registry.RenderingRegistry;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.EnumHand;
import net.minecraft.util.DamageSource;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.entity.projectile.EntityTippedArrow;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAIAttackRanged;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.Entity;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.Minecraft;

import java.util.Random;
import java.util.Iterator;
import java.util.ArrayList;

@SuppressWarnings("unchecked")
public class mcreator_hammerBro {

	public int mobid = 0;
	public static Object instance;
    
     

	public void load(FMLInitializationEvent event) {
	}

	public void generateNether(World world, Random random, int chunkX, int chunkZ) {
	}

	public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
	}

	public int addFuel(ItemStack fuel) {
		return 0;
	}

   

	@SideOnly(Side.CLIENT)
	public void registerRenderers() {
		RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new mcreator_hammerBro.ModelHammerBro(), 0) {
			protected ResourceLocation getEntityTexture(Entity par1Entity) {
				return new ResourceLocation("hammer.png");
			}
		};
		RenderingRegistry.registerEntityRenderingHandler(mcreator_hammerBro.EntityhammerBro.class, customRender);
		RenderingRegistry.registerEntityRenderingHandler(EntityArrowCustom.class, new RenderSnowball(Minecraft.getMinecraft().getRenderManager(),
				new ItemStack(Items.IRON_AXE).getItem(), Minecraft.getMinecraft().getRenderItem()));

	}

	public void serverLoad(FMLServerStartingEvent event) {
	}

	public void preInit(FMLPreInitializationEvent event) {
		int entityID = MathHelper.getRandomUUID().hashCode();
		mobid = entityID;
		EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:hammerBro"), mcreator_hammerBro.EntityhammerBro.class, "hammerBro",
				entityID, instance, 64, 1, true, (51 << 16) + (153 << 8) + 0, (0 << 16) + (0 << 8) + 0);
		EntityRegistry.addSpawn(mcreator_hammerBro.EntityhammerBro.class, 0, 3, 30, EnumCreatureType.MONSTER, clean(Biome.REGISTRY));

		int entityID2 = MathHelper.getRandomUUID().hashCode();
		EntityRegistry.registerModEntity(new ResourceLocation("testenvironmentmod:entitybullethammerbro"), EntityArrowCustom.class,
				"entitybullethammerbro", entityID2, instance, 64, 1, true);

	}

	public static Biome[] clean(net.minecraft.util.registry.RegistryNamespaced<ResourceLocation, Biome> in) {
		Iterator<Biome> itr = in.iterator();
		ArrayList<Biome> ls = new ArrayList<Biome>();
		while (itr.hasNext()) {
			ls.add(itr.next());
		}
		return ls.toArray(new Biome[ls.size()]);
	}

	public static class EntityArrowCustom extends EntityTippedArrow {
		public EntityArrowCustom(World a) {
			super(a);
		}

		public EntityArrowCustom(World worldIn, double x, double y, double z) {
			super(worldIn, x, y, z);
		}

		public EntityArrowCustom(World worldIn, EntityLivingBase shooter) {
			super(worldIn, shooter);
		}
	}

	public static class EntityhammerBro extends EntityMob implements IRangedAttackMob {
		World world = null;
          private int attacking = 0;
          

		public EntityhammerBro(World var1) {
			super(var1);
			world = var1;
			experienceValue = 5;
			this.isImmuneToFire = false;
			addRandomArmor();
			setNoAI(!true);
			this.tasks.addTask(0, new EntityAISwimming(this));
			this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
			this.tasks.addTask(8, new EntityAILookIdle(this));
			this.targetTasks.addTask(1, (new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)).setUnseenMemoryTicks(300));
			this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false));
			this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F));

		}

		protected void applyEntityAttributes() {
			super.applyEntityAttributes();
			this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D);
			this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10D);
			if (this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE) != null)
				this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3D);
		}

		protected void addRandomArmor() {

		}

         public void onUpdate()
    {
        super.onUpdate();
        
    }

		public void attackEntityWithRangedAttack(EntityLivingBase target, float flval) {
			EntityArrowCustom entityarrow = new EntityArrowCustom(this.world, this);
			double d0 = target.posY + (double) target.getEyeHeight() - 1.1;
			double d1 = target.posX - this.posX;
			double d2 = d0 - entityarrow.posY;
			double d3 = target.posZ - this.posZ;
			float f = MathHelper.sqrt(d1 * d1 + d3 * d3) * 0.2F;
			entityarrow.setThrowableHeading(d1, d2 + (double) f, d3, 1.6F, 12.0F);
			this.world.spawnEntity(entityarrow);
		}


		@Override
		protected Item getDropItem() {
			return null;
		}

		@Override
		protected net.minecraft.util.SoundEvent getAmbientSound() {
			return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation(""));
		}

		@Override
		protected net.minecraft.util.SoundEvent getHurtSound() {
			return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.hurt"));
		}

		@Override
		protected net.minecraft.util.SoundEvent getDeathSound() {
			return (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("game.neutral.die"));
		}

		@Override
		public void onStruckByLightning(EntityLightningBolt entityLightningBolt) {
			super.onStruckByLightning(entityLightningBolt);
			int i = (int) this.posX;
			int j = (int) this.posY;
			int k = (int) this.posZ;
			Entity entity = this;

		}

		@Override
		public void fall(float l, float d) {
			super.fall(l, d);
			int i = (int) this.posX;
			int j = (int) this.posY;
			int k = (int) this.posZ;
			super.fall(l, d);
			Entity entity = this;

		}

		@Override
		public void onDeath(DamageSource source) {
			super.onDeath(source);
			int i = (int) this.posX;
			int j = (int) this.posY;
			int k = (int) this.posZ;
			Entity entity = this;

		}

		@Override
		public boolean processInteract(EntityPlayer entity, EnumHand hand) {
			super.processInteract(entity, hand);
			int i = (int) this.posX;
			int j = (int) this.posY;
			int k = (int) this.posZ;

			return true;
		}

		@Override
		protected float getSoundVolume() {
			return 1.0F;
		}

         public int attack()
         {  
            return attacking;
         }
         

         public void setAttack(){
          EntityLivingBase entitylivingbase = this.getAttackTarget();
               
          if(this.getDistanceSqToEntity(entitylivingbase) < 9.0D)
          {
               attacking = 1;
              
          }
          else
          {
               attacking  = 0;
          }
         }

	}

	/**
	 * ModelGreenKoopa - Fawful Created using Tabula 5.0.0
	 */
	public static class ModelHammerBro extends ModelBase {
		public ModelRenderer shoeD1;
		public ModelRenderer legD;
		public ModelRenderer shoeD2;
		public ModelRenderer shoeD3;
		public ModelRenderer shoeG3;
		public ModelRenderer shoeG1;
		public ModelRenderer shoeG2;
		public ModelRenderer legG;
		public ModelRenderer shell1;
		public ModelRenderer shell2;
		public ModelRenderer shell3;
		public ModelRenderer shell4;
		public ModelRenderer armD;
		public ModelRenderer fistD;
		public ModelRenderer armG;
		public ModelRenderer fistG;
		public ModelRenderer cou;
		public ModelRenderer queue;
		public ModelRenderer oeil1;
		public ModelRenderer bec1;
		public ModelRenderer bec2;
		public ModelRenderer bec3;
		public ModelRenderer bec4;
		public ModelRenderer bec5;
		public ModelRenderer bec6;
		public ModelRenderer casque2;
		public ModelRenderer oreillette1;
		public ModelRenderer lacet;
		public ModelRenderer casque3;
		public ModelRenderer casque1;
		public ModelRenderer oreillette2;
		public ModelRenderer head;
		public ModelRenderer oeil2;
		public ModelRenderer arriere;
		public ModelRenderer manche;
		public ModelRenderer tete;

		public ModelHammerBro() {
			this.textureWidth = 128;
			this.textureHeight = 128;
			this.shoeD3 = new ModelRenderer(this, 44, 8);
			this.shoeD3.setRotationPoint(-3.4F, 10.0F, 0.0F);
			this.shoeD3.addBox(-2.5F, 9.0F, -6.0F, 5, 5, 3, 0.0F);
			this.shell3 = new ModelRenderer(this, 42, 50);
			this.shell3.setRotationPoint(0.0F, 3.1F, 7.6F);
			this.shell3.addBox(-3.5F, -5.0F, -1.0F, 7, 10, 2, 1.0F);
			this.setRotateAngle(shell3, 0.27314402793711257F, 0.0F, 0.0F);
			this.oreillette1 = new ModelRenderer(this, 74, 20);
			this.oreillette1.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.oreillette1.addBox(4.3F, -1.2F, 0.5F, 2, 3, 4, 0.0F);
			this.setRotateAngle(oreillette1, -0.7285004297824331F, 0.0F, 0.0F);
			this.casque1 = new ModelRenderer(this, 0, 100);
			this.casque1.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.casque1.addBox(-6.0F, -3.2F, -6.5F, 12, 3, 14, 0.0F);
			this.setRotateAngle(casque1, -0.7285004297824331F, 0.0F, 0.0F);
			this.manche = new ModelRenderer(this, 0, 118);
			this.manche.setRotationPoint(-4.0F, 0.0F, -1.8F);
			this.manche.addBox(-1.0F, 11.0F, -5.0F, 2, 2, 8, 0.0F);
			this.setRotateAngle(manche, 0.0F, 0.0F, 0.5462880558742251F);
			this.armD = new ModelRenderer(this, 0, 0);
			this.armD.setRotationPoint(-4.0F, 0.0F, -1.8F);
			this.armD.addBox(-1.5F, 0.0F, -1.5F, 3, 10, 3, 0.1F);
			this.setRotateAngle(armD, 0.0F, 0.0F, 0.5462880558742251F);
			this.queue = new ModelRenderer(this, 0, 0);
			this.queue.setRotationPoint(0.0F, 14.0F, 3.0F);
			this.queue.addBox(-1.0F, -1.0F, -2.0F, 2, 2, 6, 0.0F);
			this.setRotateAngle(queue, -0.9105382707654417F, 0.0F, 0.0F);
			this.casque3 = new ModelRenderer(this, 0, 70);
			this.casque3.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.casque3.addBox(-5.0F, -6.5F, -5.5F, 10, 4, 12, 0.0F);
			this.setRotateAngle(casque3, -0.7285004297824331F, 0.0F, 0.0F);
			this.oeil1 = new ModelRenderer(this, 90, 4);
			this.oeil1.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.oeil1.addBox(0.5F, -2.8F, -3.8F, 3, 4, 1, 0.0F);
			this.bec5 = new ModelRenderer(this, 90, 40);
			this.bec5.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec5.addBox(-3.0F, 1.0F, -6.6F, 6, 4, 5, 0.0F);
			this.setRotateAngle(bec5, -0.18203784098300857F, 0.0F, 0.0F);
			this.lacet = new ModelRenderer(this, 62, 50);
			this.lacet.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.lacet.addBox(-5.5F, -1.70F, 1.5F, 11, 8, 2, 0.0F);
			this.setRotateAngle(lacet, -0.40980330836826856F, 0.0F, 0.0F);
			this.bec2 = new ModelRenderer(this, 90, 30);
			this.bec2.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec2.addBox(-1.0F, 3.8F, -7.6F, 2, 1, 1, 0.0F);
			this.setRotateAngle(bec2, 0.091106186954104F, 0.0F, 0.0F);
			this.shell4 = new ModelRenderer(this, 42, 27);
			this.shell4.setRotationPoint(0.0F, 5.0F, 1.0F);
			this.shell4.addBox(-7.0F, -7.9F, 0.0F, 14, 17, 2, 1.0F);
			this.setRotateAngle(shell4, 0.27314402793711257F, 0.0F, 0.0F);
			this.fistD = new ModelRenderer(this, 0, 0);
			this.fistD.setRotationPoint(-4.0F, 0.0F, -1.8F);
			this.fistD.addBox(-2.0F, 10.0F, -2.0F, 4, 4, 4, 0.2F);
			this.setRotateAngle(fistD, 0.0F, 0.0F, 0.5462880558742251F);
			this.bec6 = new ModelRenderer(this, 90, 30);
			this.bec6.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec6.addBox(-3.0F, 4.0F, -4.7F, 6, 2, 6, 0.0F);
			this.setRotateAngle(bec6, -0.136659280431156F, 0.0F, 0.0F);
			this.fistG = new ModelRenderer(this, 0, 0);
			this.fistG.setRotationPoint(4.0F, 0.0F, -1.8F);
			this.fistG.addBox(-2.0F, 10.0F, -2.0F, 4, 4, 4, 0.2F);
			this.setRotateAngle(fistG, 0.0F, 0.0F, -0.5462880558742251F);
			this.cou = new ModelRenderer(this, 70, 0);
			this.cou.setRotationPoint(0.0F, -4.0F, -2.0F);
			this.cou.addBox(-2.5F, -4.0F, -2.5F, 5, 6, 3, 0.0F);
			this.setRotateAngle(cou, 0.36425021489121656F, 0.0F, 0.0F);
			this.head = new ModelRenderer(this, 90, 0);
			this.head.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.head.addBox(-4.5F, -3.5F, -3.5F, 9, 9, 9, 0.0F);
			this.casque2 = new ModelRenderer(this, 90, 50);
			this.casque2.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.casque2.addBox(-4.0F, -8.2F, -4.5F, 8, 4, 10, 0.0F);
			this.setRotateAngle(casque2, -0.7285004297824331F, 0.0F, 0.0F);
			this.oreillette2 = new ModelRenderer(this, 74, 20);
			this.oreillette2.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.oreillette2.addBox(-6.3F, -1.2F, 0.5F, 2, 3, 4, 0.0F);
			this.setRotateAngle(oreillette2, -0.7285004297824331F, 0.0F, 0.0F);
			this.legD = new ModelRenderer(this, 0, 0);
			this.legD.setRotationPoint(-3.4F, 10.0F, 0.0F);
			this.legD.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 4, 0.0F);
			this.legG = new ModelRenderer(this, 0, 0);
			this.legG.setRotationPoint(3.4F, 10.0F, 0.0F);
			this.legG.addBox(-2.0F, 0.0F, -2.0F, 4, 10, 4, 0.0F);
			this.shell1 = new ModelRenderer(this, 0, 16);
			this.shell1.setRotationPoint(0.0F, 5.0F, 1.0F);
			this.shell1.addBox(-5.5F, -6.5F, -3.0F, 11, 14, 8, 1.0F);
			this.setRotateAngle(shell1, 0.27314402793711257F, 0.0F, 0.0F);
			this.shoeG2 = new ModelRenderer(this, 38, 0);
			this.shoeG2.setRotationPoint(3.4F, 10.0F, 0.0F);
			this.shoeG2.addBox(-2.5F, 8.0F, -2.5F, 5, 2, 5, 0.0F);
			this.bec4 = new ModelRenderer(this, 90, 30);
			this.bec4.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec4.addBox(-2.0F, 2.8F, -7.6F, 4, 1, 2, 0.0F);
			this.setRotateAngle(bec4, 0.091106186954104F, 0.0F, 0.0F);
			this.shoeG3 = new ModelRenderer(this, 44, 8);
			this.shoeG3.setRotationPoint(3.4F, 10.0F, 0.0F);
			this.shoeG3.addBox(-2.5F, 9.0F, -6.0F, 5, 5, 3, 0.0F);
			this.bec3 = new ModelRenderer(this, 90, 30);
			this.bec3.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec3.addBox(-2.5F, 4.6F, -3.8F, 5, 2, 4, 0.0F);
			this.setRotateAngle(bec3, -0.136659280431156F, 0.0F, 0.0F);
			this.shoeD2 = new ModelRenderer(this, 38, 0);
			this.shoeD2.setRotationPoint(-3.4F, 10.0F, 0.0F);
			this.shoeD2.addBox(-2.5F, 8.0F, -2.5F, 5, 2, 5, 0.0F);
			this.bec1 = new ModelRenderer(this, 90, 20);
			this.bec1.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.bec1.addBox(-5.0F, 1.0F, -4.0F, 10, 4, 4, 0.0F);
			this.oeil2 = new ModelRenderer(this, 90, 0);
			this.oeil2.setRotationPoint(0.0F, -9.0F, -4.2F);
			this.oeil2.addBox(-3.5F, -2.8F, -3.8F, 3, 4, 1, 0.0F);
			this.arriere = new ModelRenderer(this, 37, 121);
			this.arriere.setRotationPoint(-4.0F, 0.0F, -1.8F);
			this.arriere.addBox(-1.5F, 8.0F, -5.0F, 3, 4, 3, 0.0F);
			this.setRotateAngle(arriere, -0.22759093446006054F, 0.0F, 0.5462880558742251F);
			this.shoeD1 = new ModelRenderer(this, 18, 0);
			this.shoeD1.setRotationPoint(-3.4F, 10.0F, 0.0F);
			this.shoeD1.addBox(-2.5F, 10.0F, -4.0F, 5, 4, 7, 0.0F);
			this.armG = new ModelRenderer(this, 0, 0);
			this.armG.setRotationPoint(4.0F, 0.0F, -1.8F);
			this.armG.addBox(-1.5F, 0.0F, -1.5F, 3, 10, 3, 0.2F);
			this.setRotateAngle(armG, 0.0F, 0.0F, -0.5462880558742251F);
			this.shoeG1 = new ModelRenderer(this, 18, 0);
			this.shoeG1.setRotationPoint(3.4F, 10.0F, 0.0F);
			this.shoeG1.addBox(-2.5F, 10.0F, -4.0F, 5, 4, 7, 0.0F);
			this.tete = new ModelRenderer(this, 21, 118);
			this.tete.setRotationPoint(-4.0F, 0.0F, -1.8F);
			this.tete.addBox(-2.0F, 9.0F, -8.0F, 4, 6, 4, 0.0F);
			this.setRotateAngle(tete, 0.0F, 0.0F, 0.5462880558742251F);
			this.shell2 = new ModelRenderer(this, 0, 39);
			this.shell2.setRotationPoint(0.0F, 5.0F, 2.0F);
			this.shell2.addBox(-4.5F, -6.0F, -5.5F, 9, 12, 11, 1.0F);
			this.setRotateAngle(shell2, 0.27314402793711257F, 0.007853981633974483F, 0.0F);

            
               
               
                            
		}

		@Override
		public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
         
       
        


        
			this.shoeD3.render(f5);
			this.shell3.render(f5);
			this.oreillette1.render(f5);
			this.casque1.render(f5);
			this.manche.render(f5);
			this.armD.render(f5);
			this.queue.render(f5);
			this.casque3.render(f5);
			this.oeil1.render(f5);
			this.bec5.render(f5);
			this.lacet.render(f5);
			this.bec2.render(f5);
			this.shell4.render(f5);
			this.fistD.render(f5);
			this.bec6.render(f5);
			this.fistG.render(f5);
			this.cou.render(f5);
			this.head.render(f5);
			this.casque2.render(f5);
			this.oreillette2.render(f5);
			this.legD.render(f5);
			this.legG.render(f5);
			this.shell1.render(f5);
			this.shoeG2.render(f5);
			this.bec4.render(f5);
			this.shoeG3.render(f5);
			this.bec3.render(f5);
			this.shoeD2.render(f5);
			this.bec1.render(f5);
			this.oeil2.render(f5);
			this.arriere.render(f5);
			this.shoeD1.render(f5);
			this.armG.render(f5);
			this.shoeG1.render(f5);
			this.tete.render(f5);
			this.shell2.render(f5);
            
            
		}

		/**
		 * This is a helper function from Tabula to set the rotation of model
		 * parts
		 */
		public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
			modelRenderer.rotateAngleX = x;
			modelRenderer.rotateAngleY = y;
			modelRenderer.rotateAngleZ = z;
		}

         public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity e)

{  
        this.shoeG3.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        this.shoeG2.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        this.shoeG1.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        this.legG.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
        this.shoeD3.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.shoeD2.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.shoeD1.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.legD.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.armG.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
        this.fistG.rotateAngleX = MathHelper.cos(f * 1.0F) * 1.0F * f1;
       
           
        

         this.bec1.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec1.rotateAngleX = f4 / ( 180F / (float)Math.PI);
         this.head.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.head.rotateAngleX = f4 / ( 180F / (float)Math.PI);
         this.oeil1.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.oeil1.rotateAngleX = f4 / ( 180F / (float)Math.PI);
         this.oeil2.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.oeil2.rotateAngleX = f4 / ( 180F / (float)Math.PI);
         this.casque1.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.casque1.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.7285004297824331F;
         this.casque2.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.casque2.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.7285004297824331F;
         this.casque3.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.casque3.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.7285004297824331F;
         this.bec2.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec2.rotateAngleX = f4 / ( 180F / (float)Math.PI) +0.091106186954104F;
         this.bec4.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec4.rotateAngleX = f4 / ( 180F / (float)Math.PI) +0.091106186954104F;
         this.bec5.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec5.rotateAngleX = f4 / ( 180F / (float)Math.PI) - 0.18203784098300857F;
         this.bec3.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec3.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.136659280431156F;
         this.bec6.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.bec6.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.136659280431156F;
         this.oreillette1.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.oreillette1.rotateAngleX = f4 / ( 180F / (float)Math.PI) - 0.18203784098300857F;
         this.oreillette2.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.oreillette2.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.136659280431156F;
         this.lacet.rotateAngleY = f3 / ( 180F / (float)Math.PI);
         this.lacet.rotateAngleX = f4 / ( 180F / (float)Math.PI) -0.7285004297824331F;
         this.fistD.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
         this.armD.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
         this.manche.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
         this.tete.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
         this.arriere.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1 -0.22759093446006054F;
             

           EntityhammerBro entityhammerBro = (mcreator_hammerBro.EntityhammerBro)e;   
           
       

              if(entityhammerBro.attack() == 1)
              {
               this.fistD.rotateAngleX = (MathHelper.cos(f * 1.0F) * -1.0F * f1) - 2.5F;
               this.armD.rotateAngleX = (MathHelper.cos(f * 1.0F) * -1.0F * f1) - 2.5F;
               this.manche.rotateAngleX = (MathHelper.cos(f * 1.0F) * -1.0F * f1) - 2.5F;
               this.tete.rotateAngleX = (MathHelper.cos(f * 1.0F) * -1.0F * f1) - 2.5F;
               this.arriere.rotateAngleX = (MathHelper.cos(f * 1.0F) * -1.0F * f1 -0.22759093446006054F) - 2.5F;
               this.fistD.rotateAngleY = 0.5F;
               this.armD.rotateAngleY = 0.5F;
               this.manche.rotateAngleY = 0.5F;
               this.tete.rotateAngleY = 0.5F;
               this.arriere.rotateAngleY = 0.5F;
               this.fistD.rotateAngleZ = -0.5F;
               this.armD.rotateAngleZ = -0.5F;
               this.manche.rotateAngleZ = -0.5F;
               this.tete.rotateAngleZ = -0.5F;
               this.arriere.rotateAngleZ = -0.5F;
              }

             
           

         


 }
	}

}

 I made a void so when he is at 9 tiles from his target or less he should execute an action in his model part... what did I get wrong?

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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