Bassebombecraft

Bassebombecraft

18.5k Downloads

SpawnDecoy2 operator sets attributes which aren't defined on Panda entity

athrane opened this issue ยท 1 comments

commented

This is a sister investigation to #1207 in order to resolve any potential bugs.

The SpawnDecoy2 operator sets these vanilla attributes:

setAttribute(entity, MOVEMENT_SPEED, 0);
setAttribute(entity, MAX_HEALTH, spawnDecoyMaxHealth.get());
setAttribute(entity, KNOCKBACK_RESISTANCE, spawnDecoyKnockBackResistance.get());

But only the MOVEMENT_SPEED and ATTACK_DAMAGE are defined in the PandaEntity:

   public static AttributeModifierMap.MutableAttribute func_234204_eW_() {
      return MobEntity.func_233666_p_().createMutableAttribute(Attributes.MOVEMENT_SPEED, (double)0.15F).createMutableAttribute(Attributes.ATTACK_DAMAGE, 6.0D);
   }

.. the KNOCKBACK_RESISTANCE attribute is defined in the MobEntity "super class":

   public static AttributeModifierMap.MutableAttribute func_233666_p_() {
      return LivingEntity.registerAttributes().createMutableAttribute(Attributes.FOLLOW_RANGE, 16.0D).createMutableAttribute(Attributes.ATTACK_KNOCKBACK);
   }

..and MAX_HEALTH defined in the LivingEntity "super class":

   public static AttributeModifierMap.MutableAttribute registerAttributes() {
      return AttributeModifierMap.createMutableAttribute().createMutableAttribute(Attributes.MAX_HEALTH).createMutableAttribute(Attributes.KNOCKBACK_RESISTANCE).createMutableAttribute(Attributes.MOVEMENT_SPEED).createMutableAttribute(Attributes.ARMOR).createMutableAttribute(Attributes.ARMOR_TOUGHNESS).createMutableAttribute(net.minecraftforge.common.ForgeMod.SWIM_SPEED.get()).createMutableAttribute(net.minecraftforge.common.ForgeMod.NAMETAG_DISTANCE.get()).createMutableAttribute(net.minecraftforge.common.ForgeMod.ENTITY_GRAVITY.get());
   }

commented

So no code changes are required. Issue is closed.