Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

My problem is that the "entity.inventory.consumeInventoryItem(StuffForMC.itemPortableVoid)" removes the Item in my inventory, until i Right-click the slot where it was before. If i do this the Item will appear again. I played around with it but couldn't find a solution ("!world.isRemote" didn't work)

The Block class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryBasic;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock7outof8;

public class Block_Brocken_Bedrock_7_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_7_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_7_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockFullyBrockenBedrock, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	if(true){
		entity.inventory.consumeInventoryItem(StuffForMC.itemPortableVoid);
	}

	if(true){
		entity.inventory.addItemStackToInventory(new ItemStack(Blocks.dragon_egg, 1));
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock7outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock7outof8");
}
}

  • Author

I want the item "Portable void" to be removed and the "dragon egg" to be added (replace "Portable void" with "dragon egg"). Now I kind of don´t know how to do that.

  • Author

Well the Block Block_Brocken_Bedrock_7_out_of_8 is part of a chain of blocks that remove themselves after 1/4 sec.

(Block_Brocken_Bedrock_0_out_of_8 ->Block_Brocken_Bedrock_2_out_of_8 -> ... -> Block_Brocken_Bedrock_7_out_of_8)

The Block: "Block_Brocken_Bedrock_0_out_of_8" is created by right-clicking a normal bedrock with the "Portable Void". At the end of the chain the block (Block_Brocken_Bedrock_7_out_of_8)  gets repleaced by the Block "FullyBrockenBedrock", removes the item "Portable Void" and adds the dragon egg to the inventory.

Just in case:

Block_Brocken_Bedrock_0_out_of_8.class:

package blocks;

import java.util.Random;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityFullyBrockenBedrock;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class Block_Brocken_Bedrock_0_out_of_8 extends BlockContainer{

public Block_Brocken_Bedrock_0_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_0_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock1outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 25;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock0outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock0outof8");
}
}

Block_Brocken_Bedrock_1_out_of_8.class:

package blocks;

import java.util.Random;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock1outof8;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class Block_Brocken_Bedrock_1_out_of_8 extends BlockContainer {
public Block_Brocken_Bedrock_1_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_1_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock2outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock1outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock1outof8");
}
}

Block_Brocken_Bedrock_2_out_of_8.class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock2outof8;

public class Block_Brocken_Bedrock_2_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_2_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_2_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock3outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock2outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock2outof8");
}
}

Block_Brocken_Bedrock_3_out_of_8.class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock3outof8;

public class Block_Brocken_Bedrock_3_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_3_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_3_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock4outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock3outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock3outof8");
}
}

Block_Brocken_Bedrock_4_out_of_8.class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock4outof8;

public class Block_Brocken_Bedrock_4_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_4_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_4_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock5outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock4outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock4outof8");
}
}

Block_Brocken_Bedrock_5_out_of_8.class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock5outof8;

public class Block_Brocken_Bedrock_5_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_5_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_5_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock6outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock5outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock5outof8");
}
}

Block_Brocken_Bedrock_6_out_of_8.class:

package blocks;

import java.util.Random;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tileEntitys.TileEntityBrockenBedrock0outof8;
import tileEntitys.TileEntityBrockenBedrock6outof8;

public class Block_Brocken_Bedrock_6_out_of_8  extends BlockContainer{
public Block_Brocken_Bedrock_6_out_of_8(Material material) {
	super(material);
	this.setCreativeTab(StuffForMC.tabStuffForMC);
	this.setLightLevel(1.0F);
	this.setHardness(5.0F);
	this.setStepSound(Block.soundTypeStone);
	this.setBlockName("Block_Brocken_Bedrock_6_out_of_8");
}
public void onBlockAdded(World world, int x, int y, int z){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(entity!=null&&world!=null){
	int le = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
	world.setBlockMetadataWithNotify(x, y, z, le, 2);
	}

	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));

	}

	public void updateTick(World world, int x, int y, int z, Random random){
	EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
	if(true){
	world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock7outof8, 0, 2);
	}
	if(true){
	world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "mob.zombie.woodbreak", 1.0F, 1.0F);
	}
	world.scheduleBlockUpdate(x, y, z, this, this.tickRate(world));
	}
	@Override
	public int tickRate(World world)
	{
	    return 5;
	}
public int getRenderType(){
	return -1;
}
public boolean isOpaqueCube() {
	return false;
}
public boolean renderAsNormalBlock() {
	return false;
}
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
	return new TileEntityBrockenBedrock6outof8();
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister){
	this.blockIcon = iconRegister.registerIcon("StuffForMC" + ":" + "Iconbrockenbedrock6outof8");
}
}

Block_Brocken_Bedrock_7_out_of_8.class:

(above)

Portable Void:

package items;

import java.util.List;

import org.Python.StuffForMC.StuffForMC;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.resources.Language;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;

public class Item_Portable_Void extends Item 
{
public Item_Portable_Void()
	{
	setCreativeTab(StuffForMC.tabStuffForMC);
	setMaxStackSize(1);
	setUnlocalizedName("Item_Portable_Void");
	setTextureName("StuffForMC:PortableVoid");
	}
 @SideOnly(Side.CLIENT)
    public boolean isFull3D()
    {
        return true;
    }
	public boolean onItemUse(ItemStack itemStack, EntityPlayer entity, World world, int x, int y, int z, int l, float a, float b, float c){
		float var4 = 1.0F;
		//Events
		Block activate = Blocks.bedrock;
		//exeptions
		Block ex1 = StuffForMC.blockBrockenBedrock0outof8;
		Block ex2 = StuffForMC.blockBrockenBedrock1outof8;
		Block ex3 = StuffForMC.blockBrockenBedrock2outof8;
		Block ex4 = StuffForMC.blockBrockenBedrock3outof8;
		Block ex5 = StuffForMC.blockBrockenBedrock4outof8;
		Block ex6 = StuffForMC.blockBrockenBedrock5outof8;
		Block ex7 = StuffForMC.blockBrockenBedrock6outof8;
		Block ex8 = StuffForMC.blockBrockenBedrock7outof8;

		Block block = world.getBlock(x, y, z);
		if(block!=ex1 && block!=ex2 && block!=ex3 && block!=ex4 && block!=ex5 && block!=ex6 && block!=ex7 && block!=ex8){
		if (block == activate){
		world.playRecord("portal.travel", x, y, z);
		world.setBlock(x, y, z, StuffForMC.blockBrockenBedrock0outof8);
		}else{
			world.playRecord("mob.zombie.woodbreak", x, y, z);
			world.setBlock(x, y, z, Blocks.air);
		}
		}
		return true;
	}
}

  • Author

Well, they're not completely identical but very similar. They all have differend models, textures and names. The function is mostly the same.As i said it's a chain that leads from "Block_Brocken_Bedrock_0_out_of_8" to "FullyBrockenBedrock".

  • Author

It was the first thing that came to my mind as i thought: "I need a cool bedrock breaking animation!". But if you have an idea on how to do this better then me just say it :D

  • Author

Well problems there:

1)i haven't figured out yet how exactly metadata works

2)i thought methadatablocks can't have differend models

(I'm kind of n00bie...)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.