本文整理了Java中net.minecraft.entity.Entity.setFire()
方法的一些代码示例,展示了Entity.setFire()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.setFire()
方法的具体详情如下:
包路径:net.minecraft.entity.Entity
类名称:Entity
方法名:setFire
暂无
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public void onCollide(EntityBroom broom, Entity entity, float modifierValue) {
if (modifierValue > 0) {
entity.setFire((int) modifierValue);
}
}
});
代码示例来源:origin: Vazkii/Botania
pos.entityHit.attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causeThrownDamage(this, thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.GENERIC, 12);
if(isFire())
pos.entityHit.setFire(5);
else if(world.rand.nextInt(3) == 0)
((EntityLivingBase) pos.entityHit).addPotionEffect(new PotionEffect(MobEffects.POISON, 60, 0));
代码示例来源:origin: Glitchfiend/ToughAsNails
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
if (state.getValue(BURNING) == true)
{
if (entity instanceof EntityLivingBase) {
entity.setFire(1);
}
}
}
代码示例来源:origin: Silentine/GrimoireOfGaia
@Override
public boolean attackEntityAsMob(Entity entityIn) {
if (super.attackEntityAsMob(entityIn)) {
entityIn.setFire(6);
}
return true;
}
代码示例来源:origin: SonarSonic/Calculator
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) {
super.onLeftClickEntity(stack, player, entity);
if (type == CalculatorConfig.TOOL_FIRE_DIAMOND) {
entity.setFire(4);
}
return false;
}
代码示例来源:origin: CyclopsMC/EvilCraft
@Override
public boolean attackEntityAsMob(Entity entity) {
// Ignite the attacked entity for a certain duration with a certain chance.
if(this.rand.nextFloat() < FIRE_CHANCE)
entity.setFire(this.rand.nextInt(MAX_FIRE_DURATION));
return super.attackEntityAsMob(entity);
}
代码示例来源:origin: Silentine/GrimoireOfGaia
@Override
public boolean attackEntityAsMob(Entity entityIn) {
if (super.attackEntityAsMob(entityIn)) {
entityIn.setFire(6);
}
return true;
}
代码示例来源: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: Vazkii/Psi
@Override
public Object execute(SpellContext context) throws SpellRuntimeException {
Entity targetVal = this.getParamValue(context, target);
Double timeVal = this.<Double>getParamValue(context, time);
context.verifyEntity(targetVal);
targetVal.setFire(timeVal.intValue());
return null;
}
代码示例来源:origin: vadis365/TheErebus
@Override
protected void collideWithEntity(Entity entity) {
if (!getEntityWorld().isRemote)
if (entity instanceof EntityLivingBase && !(entity instanceof EntityGasVent))
entity.setFire(5);
setDead();
super.collideWithEntity(entity);
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(2);
}
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(4);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(3);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(4);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(3);
onImpactWorld(world, x, (float) ent.posY, z, missile, null);
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, false, true), this.getEntityDamage());
ent.setFire(3);
createExplosion(world, missile, x, y, z, 0.8f);
}
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, false, true), this.getEntityDamage());
ent.setFire(3);
createExplosion(world, missile, x, y, z, 1.2f);
}
}
}
代码示例来源:origin: TeamWizardry/Wizardry
@Override
public boolean run(ModuleInstanceEffect instance, @Nonnull SpellData spell, @Nonnull SpellRing spellRing) {
World world = spell.world;
Entity targetEntity = spell.getVictim();
double time = spellRing.getAttributeValue(AttributeRegistry.DURATION, spell);
if (!spellRing.taxCaster(spell, true)) return false;
if (targetEntity != null) {
targetEntity.setFire((int) time);
world.playSound(null, targetEntity.getPosition(), ModSounds.FIRE, SoundCategory.NEUTRAL, RandUtil.nextFloat(0.35f, 0.75f), RandUtil.nextFloat(0.35f, 1.5f));
}
return true;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public void onImpactEntity(World world, Entity ent, float x, float y, float z, MissileBase missile) {
if (!world.isRemote) {
ent.attackEntityFrom(DamageType.causeEntityMissileDamage(missile.shooterLiving, true, false), this.getEntityDamage());
ent.setFire(3);
onImpactWorld(world, x, y, z, missile, null);
}
}
代码示例来源:origin: TeamWizardry/Wizardry
@Override
public boolean attackEntityAsMob(Entity entityIn) {
boolean flag = super.attackEntityAsMob(entityIn);
if (flag) {
float f = this.world.getDifficultyForLocation(new BlockPos(this)).getAdditionalDifficulty();
if (this.getHeldItemMainhand().isEmpty() && this.isBurning() && this.rand.nextFloat() < f * 0.3F) {
entityIn.setFire(2 * (int) f);
}
}
return flag;
}
内容来源于网络,如有侵权,请联系作者删除!