net.minecraft.entity.mob.HostileEntity Java Examples

The following examples show how to use net.minecraft.entity.mob.HostileEntity. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PiglinPonyModel.java    From MineLittlePony with MIT License 6 votes vote down vote up
@Override
public void updateLivingState(HostileEntity entity, IPony pony, EquineRenderManager.Mode mode) {
    super.updateLivingState(entity, pony, mode);
    leftArmPose = ArmPose.EMPTY;
    rightArmPose = entity.getMainHandStack().isEmpty() ? ArmPose.EMPTY : ArmPose.ITEM;

    if (entity instanceof PiglinEntity) {
        PiglinEntity piglinEntity = (PiglinEntity)entity;
        activity = piglinEntity.getActivity();

        if (activity == PiglinEntity.Activity.CROSSBOW_HOLD) {
            rightArmPose = ArmPose.CROSSBOW_HOLD;
        } else if (activity == PiglinEntity.Activity.CROSSBOW_CHARGE) {
            rightArmPose = ArmPose.CROSSBOW_CHARGE;
        } else if (activity == PiglinEntity.Activity.ADMIRING_ITEM) {
            leftArmPose = ArmPose.ITEM;
        }
    } else {
        activity = PiglinEntity.Activity.DEFAULT;
    }
}
 
Example #2
Source File: PiglinPonyModel.java    From MineLittlePony with MIT License 6 votes vote down vote up
@Override
public void setAngles(HostileEntity entity, float move, float swing, float ticks, float headYaw, float headPitch) {
    super.setAngles(entity, move, swing, ticks, headYaw, headPitch);

    if (activity == PiglinEntity.Activity.ADMIRING_ITEM) {
        leftArm.yaw = 0.5F;
        leftArm.pitch = -1.9F;
        leftArm.pivotY += 4;
        leftArm.pivotZ += 3;
        leftArm.pivotX += 2;
        head.pitch = MathHelper.sin(ticks / 12) / 6 + 0.5F;
        head.yaw = 0;

        head.roll = MathHelper.sin(ticks / 10) / 3F;


        helmet.copyPositionAndRotation(head);
    }

    float progress = ticks * 0.1F + move * 0.5F;
    float range = 0.08F + swing * 0.4F;
    rightFlap.roll = -0.5235988F - MathHelper.cos(progress * 1.2F) * range;
    leftFlap.roll =   0.5235988F + MathHelper.cos(progress) * range;
}
 
Example #3
Source File: CultistEntity.java    From the-hallow with MIT License 4 votes vote down vote up
public CultistEntity(EntityType<? extends HostileEntity> type, World world) {
	super(type, world);
	this.setCanPickUpLoot(true);
}
 
Example #4
Source File: HallowedEntities.java    From the-hallow with MIT License 4 votes vote down vote up
public static void init() {
	@SuppressWarnings("unused") Object classloading = SpawnRestriction.class;
	SpawnRestrictionInvoker.invokeRegister(HallowedEntities.MUMMY, SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, HostileEntity::canSpawnInDark);
	EntityComponentCallback.event(VillagerEntity.class).register((player, components) -> components.put(CANDY, new VillagerCandyComponent()));
}
 
Example #5
Source File: SpiderEntityMixin.java    From carpet-extra with GNU Lesser General Public License v3.0 4 votes vote down vote up
protected SpiderEntityMixin(EntityType<? extends HostileEntity> type, World world)
{
    super(type, world);
}
 
Example #6
Source File: GuardianEntityMixin.java    From fabric-carpet with MIT License 4 votes vote down vote up
protected GuardianEntityMixin(EntityType<? extends HostileEntity> entityType_1, World world_1)
{
    super(entityType_1, world_1);
}
 
Example #7
Source File: PonyPiglinRenderer.java    From MineLittlePony with MIT License 4 votes vote down vote up
@Override
public Identifier findTexture(HostileEntity entity) {
    return entity instanceof PiglinEntity ? NORMAL : new Identifier("minelittlepony", "textures/entity/piglin/zombified_piglin_pony.png");
}
 
Example #8
Source File: PonyPiglinRenderer.java    From MineLittlePony with MIT License 4 votes vote down vote up
@Override
protected boolean isShaking(HostileEntity entity) {
   return entity instanceof PiglinEntity && ((PiglinEntity)entity).canConvert();
}
 
Example #9
Source File: PiglinPonyModel.java    From MineLittlePony with MIT License 4 votes vote down vote up
@Override
protected boolean isZombified(HostileEntity entity) {
    return !(entity instanceof PiglinEntity);
}