@Override protected int getAttackStrength() { int res = (int) getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); return res; }
public static boolean hasAOE(@Nonnull EntityPlayer player) { return player.getEntityAttribute(AOE_XZ).getAttributeValue() > 0 || player.getEntityAttribute(AOE_Y).getAttributeValue() > 0 || player.getEntityAttribute(AOE_XYZ).getAttributeValue() > 0; }
/** * Gets the armor value of an entity. * * @param entity The entity to get the value from. * @return The value of the attribute. */ public static double getArmor (EntityLivingBase entity) { return entity.getEntityAttribute(SharedMonsterAttributes.ARMOR).getAttributeValue(); }
private double getAttackDistanceSq() { if (attackDistanceSq == -1) { double distance = npc.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).getAttributeValue(); attackDistanceSq = (int) (distance * distance); } return attackDistanceSq; }
private double getFollowDistance() { IAttributeInstance attribute = this.blitz.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE); return attribute == null ? 16.0D : attribute.getAttributeValue(); } }
private double getFollowDistance() { IAttributeInstance attribute = this.blizz.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE); return attribute == null ? 16.0D : attribute.getAttributeValue(); } }
/** * Gets an entity's max run speed in meters(blocks) per second * @param entity * @return e.x. Steve = 4.3 m/s. Horses ~7-13 */ private static double GetEntityMaxSpeed(EntityLivingBase entity) { //Steve has a movement speed of 0.1 and walks 4.3 blocks per second, //so multiply this result by 43 to convert to blocks per second return entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue() * 43; }
private double getTargetDistance() { IAttributeInstance iattributeinstance = npc.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE); //noinspection ConstantConditions return iattributeinstance == null ? 16.0D : iattributeinstance.getAttributeValue(); }
/** * Gets the armor toughness value of an entity. * * @param entity The entity to get the value from. * @return The value of the attribute. */ public static double getArmorToughness (EntityLivingBase entity) { return entity.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getAttributeValue(); }
/** * Gets a value of an attribute for an entity. * * @param entity The entity to get the value of. * @param attribute The attribute to get the value of. * @return The value of the attribute. */ public static double getAttributeValue (EntityLivingBase entity, IAttribute attribute) { return entity.getEntityAttribute(attribute).getAttributeValue(); }
/** * Gets an entity's max hit points * @param entity * @return e.x. Steve = 20 hit points */ private static int GetEntityMaxHP(EntityLivingBase entity) { return (int) entity.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); }
@Override public boolean attackEntityAsMob(@Nonnull Entity entityIn) { float f = (float) this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); return entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), f); }
@Override public boolean attackEntityAsMob(@Nonnull Entity entityIn) { super.attackEntityAsMob(entityIn); float attackDamage = (float) getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); if (entityIn instanceof EntitySpider) { attackDamage *= ZooConfig.owlSpiderDamageMultiplier.get(); } return entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), attackDamage); }
public boolean attackEntityAsMob(Entity entityIn) { boolean attacked = entityIn.attackEntityFrom( DamageSource.causeMobDamage(this), (float) getEntityAttribute(ATTACK_DAMAGE).getAttributeValue() ); if (attacked) { applyEnchantments(this, entityIn); } return attacked; }
@Override public boolean attackEntityAsMob(@Nonnull Entity target) { if (isRidden() || isDead) { return false; } super.attackEntityAsMob(target); if (!isRearing()) { makeMad(); } float damage = (float) getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); return target.attackEntityFrom(DamageSource.causeMobDamage(this), damage); }
@Override public void startExecuting() { lastExecuted = npc.ticksExisted; double dist = npc.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).getAttributeValue(); AxisAlignedBB bb = npc.getEntityBoundingBox().expand(dist, dist / 2, dist); List<NpcBase> potentialTargets = npc.world.getEntitiesWithinAABB(NpcBase.class, bb, selector); for (NpcBase npcBase : potentialTargets) { npcBase.addPotionEffect(new PotionEffect(effect)); } }
@Override public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) { super.onBlockClicked(world, pos, player); if (!world.isRemote) { RayTraceResult rayResult = ForgeHooks.rayTraceEyes(player, player.getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue() + 1); if (rayResult == null) { return; } ((TileStorageMonitor) world.getTileEntity(pos)).getNode().extract(player, rayResult.sideHit); } }
public double maxReachDistance(EntityPlayer player) { IAttributeInstance instance = player.getEntityAttribute(Attributes.extendedReach); double reachMod = instance.getAttributeValue(); ItemStack itemStack = player.getHeldItemMainhand(); if (!itemStack.isEmpty()) { if (itemStack.getItem() instanceof ItemBlock) reachMod += 0.1F;//Don't reduce block in hands range as much else reachMod -= instance.getBaseValue(); } return reachMod + defaultReachDistance(player.capabilities.isCreativeMode); }
public float getWeaponScaledDamage(ItemStack weapon, EntityLivingBase shooter) { float damage = getCustomFloatStat(weapon, CUSTOM_DAMAGE_TAG, getWeaponBaseDamage(weapon)); damage = modifyStatFromModules(WeaponStats.DAMAGE, weapon, damage); damage += damage * EnchantmentHelper.getEnchantmentLevel(MatterOverdriveEnchantments.overclock, weapon) * 0.04f; damage *= getCustomFloatStat(weapon, CUSTOM_DAMAGE_MULTIPLY_TAG, 1); damage += shooter.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue(); return damage; }
@Override public boolean attackEntityAsMob(Entity entity) { if (canEntityBeSeen(entity)) { boolean hasHitTarget = entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) ((int) this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).getAttributeValue())); if (hasHitTarget) { if (getEntityWorld().getGameRules().getBoolean("mobGriefing")) getEntityWorld().createExplosion(entity, entity.posX, entity.posY, entity.posZ, 1.0F, false); } return hasHitTarget; } return false; }