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

The following are Jave code examples for showing how to use SLIME_BALL 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: uniquecrops   File: UCRecipes.java   View Source Code Vote up 6 votes
private static ItemStack getDyeCraftingResult(int meta) {
	
	switch (meta) {
		default: return new ItemStack(Items.GHAST_TEAR);
		case 1: return new ItemStack(Items.FIRE_CHARGE, 8, 0);
		case 2: return new ItemStack(Items.DRAGON_BREATH);
		case 3: return new ItemStack(Items.DIAMOND);
		case 4: return new ItemStack(Items.GOLD_INGOT);
		case 5: return new ItemStack(Items.SLIME_BALL, 4, 0);
		case 6: return new ItemStack(Items.SADDLE);
		case 7: return new ItemStack(Blocks.CLAY, 8, 0);
		case 8: return new ItemStack(Items.IRON_INGOT, 2, 0);
		case 9: return new ItemStack(Blocks.STAINED_HARDENED_CLAY, 16, EnumDyeColor.CYAN.getMetadata());
		case 10: return new ItemStack(Items.CHORUS_FRUIT);
		case 11: return new ItemStack(Blocks.PRISMARINE, 8, 0);
		case 12: return new ItemStack(Blocks.DIRT, 3, 0);
		case 13: return new ItemStack(Items.EMERALD);
		case 14: return new ItemStack(Items.NETHER_WART);
		case 15: return new ItemStack(Items.SKULL, 1, 1);
	}
}
 
Example 2
Project: Bewitchment   File: ModBarrelRecipes.java   View Source Code Vote up 5 votes
public static void init() {

		slime = new SlimeRecipe(new ItemStack(Items.SLIME_BALL), 1200, 0);
		slime.setRegistryName(LibMod.MOD_ID, "slime");
		// potionDetonation = new PotionExplosion(ItemStack.EMPTY, ItemStack.EMPTY, 100, 200);
		// potionDetonation.setRegistryName(Reference.MID, "detonation");
		registerAll();
	}
 
Example 3
Project: Halloween   File: EntitySlimeCurse.java   View Source Code Vote up 5 votes
/**
 * Original KodaichiZero slime curse - fill the player's inventory with slime balls
 */
private void performLegacyCurse()
{
	EntityPlayer player = (EntityPlayer)this.victim;
	ItemStack stack = new ItemStack(Items.SLIME_BALL, 16 + this.rand.nextInt(17), 0);
	EntityItem entityItem = new EntityItem(this.world, this.posX, this.posY, this.posZ, stack);

	if (player.inventory.addItemStackToInventory(stack))
	{
		ForgeEventFactory.onItemPickup(entityItem, player);
		player.playSound(SoundEvents.ENTITY_SLIME_ATTACK, 0.75F, (this.rand.nextFloat() * 0.2F) + 0.9F);
	}
}
 
Example 4
Project: Mods   File: RecipesBlockLauncher.java   View Source Code Vote up 5 votes
@Override
public boolean matches(InventoryCrafting inventorycrafting, World world) {
	int launchers = 0;
	int slimeballs = 0;
	int feathers = 0;
	int ingots = 0;
	boolean activator = false;
	boolean shotblock = false;
	/*
	 * int bows=0; int flintandsteel=0; int powder=0; int redstone=0;
	 */
	for (int i = 0; i < inventorycrafting.getSizeInventory(); i++)
		if (inventorycrafting.getStackInSlot(i) != null && inventorycrafting.getStackInSlot(i).getCount() != 0)
			if (inventorycrafting.getStackInSlot(i).getItem() instanceof TNTCannon) {
				launchers++;
				activator = BlockLauncher.cannon.isActivator(inventorycrafting.getStackInSlot(i));
				shotblock = BlockLauncher.cannon.isSpreader(inventorycrafting.getStackInSlot(i));
			} else if (inventorycrafting.getStackInSlot(i).getItem() == Items.SLIME_BALL)
				slimeballs++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.FEATHER)
				feathers++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.IRON_INGOT)
				ingots++;
			else
				return false;
	if (launchers == 1 && (slimeballs == 0 || slimeballs == 4 || slimeballs == 8)
			&& (feathers == 0 || (feathers == 4 && activator)) && (ingots == 0 || ingots == 4 || (ingots == 8 && shotblock)))
		return true;
	return false;
}
 
Example 5
Project: EasyCraft   File: BlockSlimeBlock.java   View Source Code Vote up 4 votes
@Override
@SideOnly(Side.CLIENT)
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
	return Items.SLIME_BALL;
}
 
Example 6
Project: Backmemed   File: EntitySlime.java   View Source Code Vote up 4 votes
protected Item getDropItem()
{
    return this.getSlimeSize() == 1 ? Items.SLIME_BALL : null;
}
 
Example 7
Project: Backmemed   File: ParticleBreaking.java   View Source Code Vote up 4 votes
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    return new ParticleBreaking(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.SLIME_BALL);
}
 
Example 8
Project: Mods   File: RecipesBlockLauncher.java   View Source Code Vote up 4 votes
@Override
public ItemStack getCraftingResult(InventoryCrafting inventorycrafting) {
	int launchers = 0;
	int launcherslot = -1;
	int slimeballs = 0;
	int feathers = 0;
	int ingots = 0;
	/*
	 * int bows=0; int flintandsteel=0; int powder=0; int redstone=0;
	 */
	for (int i = 0; i < inventorycrafting.getSizeInventory(); i++)
		if (inventorycrafting.getStackInSlot(i) != null && inventorycrafting.getStackInSlot(i).getCount() != 0)
			if (inventorycrafting.getStackInSlot(i).getItem() instanceof TNTCannon) {
				launchers++;
				launcherslot = i;
			} else if (inventorycrafting.getStackInSlot(i).getItem() == Items.SLIME_BALL)
				slimeballs++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.FEATHER)
				feathers++;
			else if (inventorycrafting.getStackInSlot(i).getItem() == Items.IRON_INGOT)
				ingots++;
			else
				return null;
	if (launchers == 1) {
		ItemStack stack = inventorycrafting.getStackInSlot(launcherslot).copy();
		if (stack.getTagCompound() == null)
			stack.setTagCompound(new NBTTagCompound());
		if (slimeballs == 4) {
			stack.getTagCompound().setBoolean("Sticky", true);
			stack.getTagCompound().removeTag("Bouncy");
		} else if (slimeballs == 8) {
			stack.getTagCompound().setBoolean("Bouncy", true);
			stack.getTagCompound().removeTag("Sticky");
		}
		if (feathers == 4)
			stack.getTagCompound().setBoolean("Harmless", true);
		if (ingots == 8)
			stack.getTagCompound().setBoolean("Stack", true);
		else if(ingots == 4)
			stack.getTagCompound().setBoolean("Crushing", true);
		/*
		 * if(bows==1){ stack.getTagCompound().setBoolean("BowLike",true); }
		 * if(flintandsteel==1){
		 * stack.getTagCompound().setBoolean("Activator",true); }
		 * if(powder==1){ stack.getTagCompound().setBoolean("Powder", true);
		 * } if(redstone==1){ stack.getTagCompound().setBoolean("Glowstone",
		 * true); }
		 */
		return stack;
	}
	return ItemStack.EMPTY;
}
 
Example 9
Project: CustomWorldGen   File: EntitySlime.java   View Source Code Vote up 4 votes
protected Item getDropItem()
{
    return this.getSlimeSize() == 1 ? Items.SLIME_BALL : null;
}
 
Example 10
Project: CustomWorldGen   File: ParticleBreaking.java   View Source Code Vote up 4 votes
public Particle createParticle(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
{
    return new ParticleBreaking(worldIn, xCoordIn, yCoordIn, zCoordIn, Items.SLIME_BALL);
}