Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.creepinson.entities;
- import me.creepinson.entities.ai.EntityAIAttackMelee;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityCreature;
- import net.minecraft.entity.EntityLiving;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.ai.EntityAIHurtByTarget;
- import net.minecraft.entity.ai.EntityAILookIdle;
- import net.minecraft.entity.ai.EntityAISwimming;
- import net.minecraft.entity.ai.EntityAIWander;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.player.EntityPlayerMP;
- import net.minecraft.item.Item;
- import net.minecraft.util.DamageSource;
- import net.minecraft.world.World;
- import obsidianAPI.animation.wrapper.IEntityAnimated;
- public class EntityCreepino extends EntityCreature implements IEntityAnimated
- {
- public boolean isAttacked;
- World world = null;
- public EntityCreepino(World var1)
- {
- super(var1);
- world = var1;
- experienceValue = 8;
- this.isImmuneToFire = false;
- this.targetTasks.addTask(6, new EntityAIHurtByTarget(this, false));
- this.tasks.addTask(2, new EntityAIWander(this, 0.8D));
- this.tasks.addTask(2, new EntityAILookIdle(this));
- this.tasks.addTask(1, new EntityAISwimming(this));
- this.tasks.addTask(6, new EntityAIAttackMelee(this, EntityPlayer.class, 5, false));
- this.tasks.addTask(6, new EntityAIAttackMelee(this, EntityPlayerMP.class, 5, false));
- this.isAttacked = false;
- }
- protected void applyEntityAttributes(){
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.15D);
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(14D);
- if(this.getEntityAttribute(SharedMonsterAttributes.attackDamage)!=null)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
- }
- @Override
- public boolean isMoving() {
- return limbSwingAmount > 0.02F;
- }
- public boolean isAIEnabled()
- {
- return true;
- }
- @Override
- protected Item getDropItem()
- {
- return null;
- }
- /**
- * Returns the sound this mob makes while it's alive.
- */
- protected String getLivingSound()
- {
- return "meepersplus:creepino.screech";
- }
- /**
- * Returns the sound this mob makes when it is hurt.
- */
- protected String getHurtSound()
- {
- return "meepersplus:creepino.hurt";
- }
- /**
- * Returns the sound this mob makes on death.
- */
- protected String getDeathSound()
- {
- return "meepersplus:creepino.death";
- }
- 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;
- motionY = 5.0D;
- motionY = 0.0D;
- }
- private int ticks;
- @Override
- public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) {
- this.isAttacked = true;
- if(ticks == 40){
- ticks = 0;
- }
- if(ticks == 20){
- if(this.isAttacked){
- this.isAttacked = false;
- }
- }
- return super.attackEntityFrom(p_70097_1_, p_70097_2_);
- }
- @Override
- public void onUpdate() {
- ticks++;
- super.onUpdate();
- }
- protected void fall(float l){
- super.fall(l);
- int i = (int)this.posX;
- int j = (int)this.posY;
- int k = (int)this.posZ;
- super.fall(l);
- Entity entity = this;
- }
- public void onDeath(DamageSource dsource) {
- super.onDeath(dsource);
- int i = (int)this.posX;
- int j = (int)this.posY;
- int k = (int)this.posZ;
- Entity entity = this;
- }
- public void onKillEntity(EntityLiving entityLiving){
- super.onKillEntity(entityLiving);
- int i = (int)this.posX;
- int j = (int)this.posY;
- int k = (int)this.posZ;
- Entity entity = this;
- }
- public boolean interact(EntityPlayer entity){
- super.interact(entity);
- int i = (int)this.posX;
- int j = (int)this.posY;
- int k = (int)this.posZ;
- return true;
- }
- public String getEntityName(){
- return "Creepino";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement