Java Code Examples for net.minecraft.init.Items.COMMAND_BLOCK_MINECART

The following are Jave code examples for showing how to use COMMAND_BLOCK_MINECART 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: CustomWorldGen   File: EntityMinecart.java   View Source Code Vote up 6 votes
/**
 * This function returns an ItemStack that represents this cart.
 * This should be an ItemStack that can be used by the player to place the cart,
 * but is not necessary the item the cart drops when destroyed.
 * @return An ItemStack that can be used to place the cart.
 */
public ItemStack getCartItem()
{
    if (this instanceof EntityMinecartFurnace)
    {
        return new ItemStack(Items.FURNACE_MINECART);
    }
    else if (this instanceof EntityMinecartChest)
    {
        return new ItemStack(Items.CHEST_MINECART);
    }
    else if (this instanceof EntityMinecartTNT)
    {
        return new ItemStack(Items.TNT_MINECART);
    }
    else if (this instanceof EntityMinecartHopper)
    {
        return new ItemStack(Items.HOPPER_MINECART);
    }
    else if (this instanceof EntityMinecartCommandBlock)
    {
        return new ItemStack(Items.COMMAND_BLOCK_MINECART);
    }
    return new ItemStack(Items.MINECART);
}