net.minecraft.entity.Entity.isCreatureType()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中net.minecraft.entity.Entity.isCreatureType()方法的一些代码示例,展示了Entity.isCreatureType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.isCreatureType()方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:isCreatureType

Entity.isCreatureType介绍

暂无

代码示例

代码示例来源:origin: Alex-the-666/Ice_and_Fire

public static boolean isAnimaniaChicken(Entity entity){
  String className = entity.getClass().getName();
  return (className.contains("chicken") || entity instanceof EntityChicken) && entity instanceof EntityLiving && !entity.isCreatureType(EnumCreatureType.MONSTER, false);
}

代码示例来源:origin: TeamLapen/Vampirism

@SubscribeEvent
public void onEntityCheckSpawn(LivingSpawnEvent.CheckSpawn event) {
  IBlockState blockState = event.getWorld().getBlockState(new BlockPos(event.getX() - 0.4F, event.getY(), event.getZ() - 0.4F).down());
  if (blockState.getBlock().equals(ModBlocks.castle_block)) {
    if (BlockCastleBlock.EnumType.DARK_STONE.equals(blockState.getValue(BlockCastleBlock.VARIANT)) || !event.getEntity().isCreatureType(VReference.VAMPIRE_CREATURE_TYPE, false)) {
      event.setResult(Event.Result.DENY);
    }
  } else if (blockState.getBlock() instanceof BlockCastleStairs) {
    if (ModBlocks.castle_stairs_dark_stone.equals(blockState.getBlock()) || !event.getEntity().isCreatureType(VReference.VAMPIRE_CREATURE_TYPE, false)) {
      event.setResult(Event.Result.DENY);
    }
  }
}

代码示例来源:origin: PrinceOfAmber/Cyclic

if (mop.entityHit != null) {
 if (mop.entityHit.isCreatureType(EnumCreatureType.MONSTER, false)
   || mop.entityHit instanceof EntityPlayer) {
  mop.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), damage);

相关文章

微信公众号

最新文章

更多

Entity类方法