Fixed skeletons not lifting their arms when the player fires a bow

This commit is contained in:
Sollace 2020-09-28 21:27:46 +02:00
parent 97f2eda351
commit 019a8da48d

View file

@ -13,6 +13,7 @@ import net.minecraft.entity.EntityType;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.FallingBlockEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.AbstractSkeletonEntity;
import net.minecraft.entity.passive.TameableEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
@ -140,6 +141,10 @@ public class EntityBehaviour<T extends Entity> {
((TameableEntity)to).setSitting(from.isSneaking());
}
if (to instanceof AbstractSkeletonEntity) {
((AbstractSkeletonEntity)to).setAttacking(from.getItemUseTimeLeft() > 0);
}
if (from.age < 100 || from instanceof PlayerEntity && ((PlayerEntity)from).isCreative()) {
to.extinguish();
}