use of net.minecraft.entity.passive.EntityParrot in project Bewitchment by Um-Mitternacht.
the class FortuneMeetParrot method apply.
@Override
public boolean apply(EntityPlayer player) {
for (int i = 0; i < 10; i++) {
BlockPos pos = new BlockPos(player.posX + player.getRNG().nextGaussian() * 4, player.posY, player.posZ + player.getRNG().nextGaussian() * 4);
EntityParrot parrot = new EntityParrot(player.world);
if (player.world.isAirBlock(pos) && player.world.isAirBlock(pos.up()) && player.world.getBlockState(pos.down()).canEntitySpawn(parrot)) {
parrot.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
parrot.onInitialSpawn(player.world.getDifficultyForLocation(pos), null);
parrot.setTamedBy(player);
player.world.spawnEntity(parrot);
return true;
}
}
return false;
}
use of net.minecraft.entity.passive.EntityParrot in project takumicraft by TNTModders.
the class EntityParrotCreeper method takumiExplodeEvent.
@Override
public boolean takumiExplodeEvent(Detonate event) {
for (Entity entity : event.getAffectedEntities()) {
if (!this.world.isRemote && entity instanceof EntityPlayer) {
EntityParrot parrot = new EntityParrot(this.world);
parrot.copyLocationAndAnglesFrom(this);
NBTTagCompound tagCompound = parrot.getEntityData();
tagCompound.setBoolean("creeper", true);
parrot.setVariant(2);
parrot.setCustomNameTag(TakumiUtils.takumiTranslate("entity.parrotcreeper.name"));
parrot.setEntityOnShoulder((EntityPlayer) entity);
}
}
event.getAffectedEntities().clear();
return true;
}
Aggregations