Java Code Examples for net.minecraft.entity.player.EntityPlayer.setFire()

The following are Jave code examples for showing how to use setFire() of the net.minecraft.entity.player.EntityPlayer class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: uniquecrops   File: BlockLavaLily.java   View Source Code Vote up 6 votes
@Override
  public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
  	
if (world.isRemote)
	return;

if (entity instanceof EntityPlayer) {
	EntityPlayer ep = (EntityPlayer)entity;
	if (!ep.capabilities.isCreativeMode) {
		ItemStack boots = ep.inventory.armorInventory[0];
		if (boots == null)
			ep.setFire(3);
	}
}
else if (entity instanceof EntityLiving) {
	EntityLiving el = (EntityLiving)entity;
	if (!el.isImmuneToFire()) {
		el.setFire(3);
	}
}
  }
 
Example 2
Project: Industrial-Foregoing   File: LavaStrawHandler.java   View Source Code Vote up 5 votes
@Override
public void onDrink(World world, BlockPos pos, FluidStack stack, EntityPlayer player, boolean fromFluidContainer) {
    player.attackEntityFrom(DamageSource.LAVA, 7);
    player.setFire(30);
    NBTTagCompound tag = player.getEntityData();
    tag.setLong("lavaDrink", world.getTotalWorldTime());
}
 
Example 3
Project: minecraft-quiverbow   File: BlazeShot.java   View Source Code Vote up 5 votes
@Override
public void onCollideWithPlayer(EntityPlayer player)	// Burning while stuck in the ground
   {
	if (this.worldObj.isRemote) { return; }	// Not doing this on client side
	if (!this.inGround) { return; }			// Not stuck in the ground
	if (this.arrowShake > 0) { return; }	// Not... done shaking?
	
	// Ready to hurt someone!
	player.setFire(this.fireDuration / 2);	// Half burn time. Let's be lenient here
   }
 
Example 4
Project: Bewitchment   File: ItemGinger.java   View Source Code Vote up 4 votes
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) {
	player.setFire(10);
}
 
Example 5
Project: rtap   File: foodPeppers.java   View Source Code Vote up 2 votes
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player) {
	
	player.setFire(2);
	
}