Java Code Examples for net.minecraft.init.Items.carrot_on_a_stick()

The following are Jave code examples for showing how to use carrot_on_a_stick() of the net.minecraft.init.Items 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: DecompiledMinecraft   File: EntityPig.java   View Source Code Vote up 4 votes
/**
 * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden
 * by a player and the player is holding a carrot-on-a-stick
 */
public boolean canBeSteered()
{
    ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem();
    return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
}
 
Example 2
Project: DecompiledMinecraft   File: EntityPig.java   View Source Code Vote up 4 votes
/**
 * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden
 * by a player and the player is holding a carrot-on-a-stick
 */
public boolean canBeSteered()
{
    ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem();
    return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
}
 
Example 3
Project: BaseClient   File: EntityPig.java   View Source Code Vote up 4 votes
/**
 * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden
 * by a player and the player is holding a carrot-on-a-stick
 */
public boolean canBeSteered()
{
    ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem();
    return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
}
 
Example 4
Project: BaseClient   File: EntityPig.java   View Source Code Vote up 4 votes
/**
 * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden
 * by a player and the player is holding a carrot-on-a-stick
 */
public boolean canBeSteered()
{
    ItemStack itemstack = ((EntityPlayer)this.riddenByEntity).getHeldItem();
    return itemstack != null && itemstack.getItem() == Items.carrot_on_a_stick;
}