本文整理汇总了Java中net.minecraft.entity.ai.EntityAIOpenDoor类的典型用法代码示例。如果您正苦于以下问题:Java EntityAIOpenDoor类的具体用法?Java EntityAIOpenDoor怎么用?Java EntityAIOpenDoor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityAIOpenDoor类属于net.minecraft.entity.ai包,在下文中一共展示了EntityAIOpenDoor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: EntityVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityVillager(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例2: spawnEvent
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
@SubscribeEvent
public void spawnEvent(EntityJoinWorldEvent event) {
if (event.entity instanceof EntityPig) {
EntityPig pig = (EntityPig) event.entity;
if (EtFuturum.enableBeetroot)
pig.tasks.addTask(4, new EntityAITempt(pig, 1.2, ModItems.beetroot, false));
} else if (event.entity instanceof EntityChicken) {
EntityChicken chicken = (EntityChicken) event.entity;
if (EtFuturum.enableBeetroot)
chicken.tasks.addTask(3, new EntityAITempt(chicken, 1.0D, ModItems.beetroot_seeds, false));
} else if (event.entity instanceof EntityWolf) {
EntityWolf wolf = (EntityWolf) event.entity;
if (EtFuturum.enableRabbit)
wolf.targetTasks.addTask(4, new EntityAITargetNonTamed(wolf, EntityRabbit.class, 200, false));
} else if (event.entity instanceof EntityVillager) {
EntityVillager villager = (EntityVillager) event.entity;
for (Object obj : villager.tasks.taskEntries) {
EntityAITaskEntry entry = (EntityAITaskEntry) obj;
if (entry.action instanceof EntityAIOpenDoor) {
villager.tasks.removeTask(entry.action);
villager.tasks.addTask(entry.priority, new EntityAIOpenCustomDoor(villager, true));
break;
}
}
}
}
示例3: initEntityAI
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityEvoker.class, 12.0F, 0.8D, 0.8D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVindicator.class, 8.0F, 0.8D, 0.8D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityVex.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWanderAvoidWater(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例4: initEntityAI
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
protected void initEntityAI()
{
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIVillagerInteract(this));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例5: EntityLostSoul
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityLostSoul(World world) {
super(world);
//this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIOpenDoor(this, true));
this.tasks.addTask(4, new EntityAIBreakBlock(this, Blocks.TORCH));
/*
this.tasks.addTask(2, new EntityAIAttackMelee(this, EntityPlayer.class, 1.0D, false));
this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D));
this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1.0D, false));
this.tasks.addTask(6, new EntityAIWander(this, 1.0D));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false));
* */
}
示例6: GGPMobNPC
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public GGPMobNPC(World par1World, String customName) {
super(par1World);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, false));
this.setCustomNameTag(customName);
}
示例7: EntityARVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityARVillager(World par1World)
{
super(par1World);
this.randomTickDivider = 0;
this.isMating = false;
this.isPlaying = false;
this.villageObj = null;
this.setSize(0.6F, 2.35F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.3F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 15.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 15.0F, 0.05F));
this.tasks.addTask(9, new EntityAIWander(this, 0.3F));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 15.0F));
}
示例8: EntityVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityVillager(World par1World, int par2)
{
super(par1World);
this.setProfession(par2);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(8, new EntityAIPlay(this, 0.32D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例9: EntityGreenVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityGreenVillager(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradeGreen(this));
this.tasks.addTask(1, new EntityAILookAtTradeGreen(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例10: EntityRana
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityRana(World par1World, int par2)
{
super(par1World);
randomTickDivider = 0;
isPlayingFlag = false;
villageObj = null;
setProfession(par2);
dead = false;
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySkeleton.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntitySpider.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityTNTPrimed.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityCreeper.class, 8.0F, 0.6D, 0.6D));
tasks.addTask(5, new EntityAIMoveIndoors(this));
tasks.addTask(6, new EntityAIRestrictOpenDoor(this));
tasks.addTask(7, new EntityAIOpenDoor(this, true));
tasks.addTask(8, new EntityAIMoveTowardsRestriction(this, 0.3F));
tasks.addTask(9, new EntityAIWatchClosest2(this, net.minecraft.entity.player.EntityPlayer.class, 3F, 1.0F));
tasks.addTask(10, new EntityAIWatchClosest2(this, net.minecraft.entity.passive.EntityVillager.class, 5F, 0.02F));
tasks.addTask(11, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntityRana.class, 5F, 0.02F));
tasks.addTask(12, new EntityAIWatchClosest2(this, com.stormister.rediscovered.EntitySteve.class, 5F, 0.02F));
tasks.addTask(13, new EntityAIWander(this, 0.3F));
tasks.addTask(14, new EntityAIWatchClosest(this, net.minecraft.entity.EntityLiving.class, 8F));
}
示例11: EntityPigman
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityPigman(World worldIn, int professionId)
{
super(worldIn);
this.villagerInventory = new InventoryBasic("Items", false, 8);
this.setProfession(professionId);
this.setSize(0.6F, 1.8F);
((PathNavigateGround)this.getNavigator()).setBreakDoors(true);
((PathNavigateGround)this.getNavigator()).setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePigman(this));
this.tasks.addTask(1, new EntityAILookAtTradePigman(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIPigmanMate(this));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
this.setCanPickUpLoot(true);
}
示例12: EntityVenusianVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityVenusianVillager(World par1World) {
super(par1World);
this.randomTickDivider = 0;
this.villageObj = null;
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.3F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 15.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 15.0F, 0.05F));
this.tasks.addTask(9, new EntityAIWander(this, 0.3F));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 15.0F));
}
示例13: EntityMagician
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityMagician(World world) {
super(world);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(8, new EntityAIPlay(this, 0.32D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例14: EntityVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityVillager(World p_i1748_1_, int p_i1748_2_)
{
super(p_i1748_1_);
this.setProfession(p_i1748_2_);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.6D, 0.6D));
this.tasks.addTask(1, new EntityAITradePlayer(this));
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.6D));
this.tasks.addTask(6, new EntityAIVillagerMate(this));
this.tasks.addTask(7, new EntityAIFollowGolem(this));
this.tasks.addTask(8, new EntityAIPlay(this, 0.32D));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.6D));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}
示例15: EntityGreenVillager
import net.minecraft.entity.ai.EntityAIOpenDoor; //导入依赖的package包/类
public EntityGreenVillager(World par1World, int par2)
{
super(par1World);
this.randomTickDivider = 0;
this.isMating = false;
this.isPlaying = false;
this.villageObj = null;
this.setProfession(par2);
this.setSize(0.6F, 1.8F);
this.getNavigator().setBreakDoors(true);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAvoidEntity(this, EntityZombie.class, 8.0F, 0.3F, 0.35F));
this.tasks.addTask(1, new EntityAITradeGreen(this));
this.tasks.addTask(1, new EntityAILookAtTradeGreen(this));
this.tasks.addTask(2, new EntityAIMoveIndoors(this));
this.tasks.addTask(3, new EntityAIRestrictOpenDoor(this));
this.tasks.addTask(4, new EntityAIOpenDoor(this, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 0.3F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityPlayer.class, 3.0F, 1.0F));
this.tasks.addTask(9, new EntityAIWatchClosest2(this, EntityVillager.class, 5.0F, 0.02F));
this.tasks.addTask(9, new EntityAIWander(this, 0.3F));
this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F));
}