Jump to content

BoonieQuafter-CrAfTeR

Members
  • Posts

    337
  • Joined

  • Last visited

Posts posted by BoonieQuafter-CrAfTeR

  1. hey guys, im trying to make a ranged mob that throws my custom entity throwable, or a rangedmob, I've Looked at skeleton and witch code. but so far it hasn't helped much except how to make an attack timer. I was wondering if someone could point me at a tutorial, or show me how to do this. thanks

  2. how do I specifically set the damage for the lightning not the entityThrowable?

     

    if(Pos.entityHit != null)
    	       {
    	          byte b0 = 100;
    	           if (Pos.entityHit instanceof EntityLightningBolt)
    	           {
    	               b0 = 100;
    	           }
    
    		Pos.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, this.getThrower()), b0);
    	       

  3. I made an entity that strikes a large amount of lightning. problem is, when ever the entity makes contact with an entity it doesn't render on the screen. it only renders when it hits a block. how should I fix this. here is the code.

     

    package com.OlympiansMod.entity;
    
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.effect.EntityLightningBolt;
    import net.minecraft.entity.projectile.EntityLargeFireball;
    import net.minecraft.entity.projectile.EntityThrowable;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.world.World;
    
    public class EntityMasterBolt extends EntityThrowable{
    
    public EntityMasterBolt(World p_i1776_1_) {
    	super(p_i1776_1_);
    }
    public EntityMasterBolt(World world, EntityLivingBase entity){
    	super(world, entity);
    
    
    }
    @Override
    protected void onImpact(MovingObjectPosition p_70184_1_) {
    	    for(int i = 0; i < 25; i++){
    		this.worldObj.spawnParticle("largesmoke", this.posX, this.posY, this.posZ, 0f, 0f, 0f);
    		this.setDead();
    		EntityLightningBolt undead = new EntityLightningBolt(worldObj, 10, 10, 10);
    		undead.setPosition(this.posX, this.posY, this.posZ);
    		worldObj.spawnEntityInWorld(undead);
    
    
    
    
    
    	  }
    
    	if (!this.worldObj.isRemote){
    		this.setDead();
    		//his.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, 3.0f, true);
    
    	}
    
    
    	}
    }
    
    
    
    
    
    
    
    

  4. ok gotcha coolAlias

     

    this isn't working for me in my craft.

    package com.OlympiansMod.Item;
    
    import com.OlympiansMod.entity.EntityThunderBolt;
    import com.OlympiansMod.entity.EntityUndead;
    
    import net.minecraft.entity.effect.EntityLightningBolt;
    import net.minecraft.entity.monster.EntitySlime;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.projectile.EntityArrow;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.util.Vec3;
    import net.minecraft.world.World;
    
    
    public class ZThunderBolt extends Item{
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
    	if(!player.capabilities.isCreativeMode){
    		--itemstack.stackSize;
    	}
    	//world.playSoundAtEntity(player, "random.fizz", 0.7f, 0.8f);
    
    	if(!world.isRemote){
    	 Vec3 posVec = Vec3.createVectorHelper(player.posX, player.posY + player.getEyeHeight(), player.posZ);
    	 Vec3 lookVec = player.getLookVec();
    	 MovingObjectPosition mop = world.rayTraceBlocks(posVec, lookVec);
    
    	 int x = mop.blockX;
    	 int y = mop.blockY;
    	 int z = mop.blockZ;
    
    	 System.out.println(x + ","+ y + ","+ z + " " + world.getBlock(x, y, z));
    
    		EntitySlime Bolt = new EntitySlime(world);
    		Bolt.setPosition(player.posX + x , player.posY + y , player.posZ + z);
    		world.spawnEntityInWorld(Bolt);
    
    
    
    
    }
    	return itemstack;
    }
    }
    
    
    
    
    
    
    
    
    

     

    is there anything you think I should change to make it work.

  5. okay guys but that's not the problem.  I did have a typo but im getting current errors in my code specifically on new Vec3. I don't exactly know how that works. and I do know that the override goes above the method. but at this point im desperate and new to java so.. anyway what else can I do. and I have the raytraceblocks so that it finds the block that the player is looking at and defines the other int.

  6. can someone just tell me how to do it because so far nothing is working.

     

    public class ZThunderBolt extends Item{
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
    	if(!player.capabilities.isCreativeMode){
    		--itemstack.stackSize;
    	}
    	//world.playSoundAtEntity(player, "random.fizz", 0.7f, 0.8f);
    
    	//if(!world.isRemote){
    	@Override
    	 Vec3 posVec = new Vec3(player.posX, player.posY, player.posZ); 
    	 Vec3 lookVec = player.getLookVec();
    	 MovingObjectPosition mop = world.rayTraceBlocks(posVec, lookVec);
    
    	 int x = mop.blockX;
    	 int y = mop.blockY;
    	 int z = mop.blockZ;
    
    
    		EntityLightningBolt Bolt = new EntityLightningBolt(world, 5, 5, 5);
    		Bolt.setPosition(player.posX = x , player.posY + y , player.posZ + z);;
    		world.spawnEntityInWorld(Bolt);
    	//}
    
    	return itemstack;
    
    }
    
    
    }
    

  7. I want to make an item that spawns lightning were the player is looking. problem is I don't have the right code, I think its out dated because I cant find these things in the vec3 class. here is my code

     

    package com.OlympiansMod.Item;
    
    import com.OlympiansMod.entity.EntityThunderBolt;
    import com.OlympiansMod.entity.EntityUndead;
    
    import net.minecraft.entity.effect.EntityLightningBolt;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.projectile.EntityArrow;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.MovingObjectPosition;
    import net.minecraft.util.Vec3;
    import net.minecraft.world.World;
    
    
    public class ZThunderBolt extends Item{
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
    	if(!player.capabilities.isCreativeMode){
    		--itemstack.stackSize;
    	}
    	//world.playSoundAtEntity(player, "random.fizz", 0.7f, 0.8f);
    
    	//if(!world.isRemote){
    	 Vec3 posVec = world.getWorldVec3Pool().getVec3FromPool(player.posX, player.posY + player.getEyeHeight(), player.posZ);
    	 Vec3 lookVec = player.getLookVec();
    	 MovingObjectPosition mop = world.rayTraceBlocks(posVec, lookVec);
    
    	 int x = mop.blockX;
    	 int y = mop.blockY;
    	 int z = mop.blockZ;
    
    
    		EntityLightningBolt Bolt = new EntityLightningBolt(world, 5, 5, 5);
    		Bolt.setPosition(player.posX = x , player.posY + y , player.posZ + z);;
    		world.spawnEntityInWorld(Bolt);
    	//}
    
    	return itemstack;
    
    }
    
    
    }
    
    
    
    
    
    

     

    so yeah what do I do to fix it? btw syntax error on world.getWorldVec3Pool().getVec3FromPool

  8. ok, so this is some code that I put together from the iron golem class, problem is there is a syntax error on armR.attackTimer, what's wrong with it?

     

    public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_){
        	  
        	  EntityUndead undead = (EntityUndead)undead;
              int i = ((EntityIronGolem) ArmR).getAttackTimer();
    
              if (i > 0)
              {
                  this.ArmR.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)i - p_78086_2_, 10.0F);
                  
              }
             
          }
         
    
      
    
      private float func_78172_a(float p_78172_1_, float p_78172_2_){
    // TODO Auto-generated method stub
    return 0;
    } 
    

     

  9. So I want to make an animation for a attack for my mob, the problem is I don't know how, I've looked at the code for the iron golems model, but there are methods I haven't seen before there, so I don't know how to adapt the code.

    I also haven't been able to find any tutorials on it either (or at least ones that are not out dated).

     

    can someone explain it to me or show me how to create these animations?

     

    if so that would be great.

     

    thanks for your time.

  10. ok I changed it but it still is not working

     

    package com.OlympiansMod.Item;
    
    import com.OlympiansMod.entity.EntityUndead;
    
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;
    
    public class DioceltiansSepter extends Item{
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
    	if(player.capabilities.isCreativeMode){
    
    	}	
    	if(!world.isRemote);
    
    	for (int i = 0 ; i < 5 ; i++){
    	EntityUndead undead = new EntityUndead(world);
    	undead.setPosition(player.posX, player.posY, player.posZ);
    	world.spawnEntityInWorld(undead);
    
    
    
    }
    	return itemstack;
    
    
    }
    }
    
    
    

  11. okay I have a OnRightclick method that spawns 5 entitys into the world, the problem is, is that the item spawns 5 ghost entitys as well, here's my code.

    package com.OlympiansMod.Item;
    
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.World;
    
    import com.OlympiansMod.entity.EntitySGolem;
    import com.OlympiansMod.entity.EntityUndead;
    
    public class UndeadRomanSpawn extends Item{
    public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player){
    	if(!player.capabilities.isCreativeMode){
    		--itemstack.stackSize;
    
    
    	}
    
    	EntityUndead undead = new EntityUndead(world);
    	undead.setPosition(player.posX, player.posY, player.posZ);
    	world.spawnEntityInWorld(undead);
    
    
    
    
    	return itemstack;
    
    
    }
    }
    

     

     

  12. public boolean shouldExecute()
        {
            EntityLivingBase entitylivingbase = ((EntityLiving) this.attacker).getAttackTarget();
    
            if (entitylivingbase == null)
            {
                return false;
            }
            else if (!entitylivingbase.isEntityAlive())
            {
                return false;
            }
            else if (entitylivingbase instanceof EntityUndead)
            {
                return false;
            }
            else{
           
    	return true;
    
                }
             
                
                
            }
    }
        

     

    I wrote this method, the only thing different from yours is that I had to define the attacker as entity living it doesn't work.

×
×
  • Create New...

Important Information

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