本文整理了Java中net.minecraft.entity.Entity.isImmuneToFire()
方法的一些代码示例,展示了Entity.isImmuneToFire()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.isImmuneToFire()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:isImmuneToFire
暂无
代码示例来源:origin: Vazkii/Quark
@Override
public boolean canEntitySpawn(IBlockState state, Entity entityIn) {
return entityIn.isImmuneToFire();
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public void onEntityCollidedWithBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state, @Nonnull Entity entity) {
if (!world.isRemote && !entity.isImmuneToFire()) {
entity.attackEntityFrom(DamageSource.LAVA, 4.0F);
entity.setFire(15);
}
super.onEntityCollidedWithBlock(world, pos, state, entity);
}
代码示例来源:origin: Silentine/GrimoireOfGaia
@Override
protected void onImpact(RayTraceResult result) {
if (!world.isRemote) {
if (result.entityHit != null && !result.entityHit.isImmuneToFire() && result.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, shootingEntity), 5.0F)) {
result.entityHit.setFire(4);
}
setDead();
}
}
代码示例来源:origin: CoFH/ThermalFoundation
@SubscribeEvent (priority = EventPriority.NORMAL)
public void handleLivingDropsEvent(LivingDropsEvent event) {
Entity entity = event.getEntity();
if (entity.isImmuneToFire() && TFProps.dropSulfurFireImmuneMobs && event.getEntityLiving().world.getGameRules().getBoolean("doMobLoot")) {
boolean s = entity instanceof EntitySlime;
if (event.getEntityLiving().getRNG().nextInt(6 + (s ? 16 : 0)) != 0) {
return;
}
event.getDrops().add(new EntityItem(entity.world, entity.posX, entity.posY, entity.posZ, ItemMaterial.dustSulfur.copy()));
}
}
代码示例来源:origin: CoFH/ThermalFoundation
@Override
protected void onImpact(RayTraceResult traceResult) {
if (ServerHelper.isServerWorld(world)) {
if (traceResult.entityHit != null) {
if (traceResult.entityHit instanceof EntityBlizz) {
traceResult.entityHit.attackEntityFrom(DamageSourceBlizz.causeDamage(this, getThrower()), 0);
} else {
if (traceResult.entityHit.attackEntityFrom(DamageSourceBlizz.causeDamage(this, getThrower()), traceResult.entityHit.isImmuneToFire() ? 8F : 5F) && traceResult.entityHit instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) traceResult.entityHit;
if (EntityBlizz.effect) {
living.addPotionEffect(new PotionEffect(EntityBlizzBolt.blizzEffect));
}
}
}
} else {
BlockPos hitPosOffset = traceResult.getBlockPos().offset(traceResult.sideHit);
if (world.isAirBlock(hitPosOffset)) {
IBlockState state = world.getBlockState(hitPosOffset.offset(EnumFacing.DOWN));
if (state.isSideSolid(world, hitPosOffset.offset(EnumFacing.DOWN), EnumFacing.UP)) {
world.setBlockState(hitPosOffset, Blocks.SNOW_LAYER.getDefaultState());
}
}
}
for (int i = 0; i < 8; i++) {
world.spawnParticle(EnumParticleTypes.SNOWBALL, posX, posY, posZ, this.rand.nextDouble(), this.rand.nextDouble(), this.rand.nextDouble());
}
setDead();
}
}
内容来源于网络,如有侵权,请联系作者删除!