package dk.codingpirates.minecraft.mods.block;

import dk.codingpirates.minecraft.mods.CodingPiratesMod;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class PiratBoyBlock extends Block {
	
	private final String name = "piratBoyBlock";

	public PiratBoyBlock() {
		super(Material.GOURD);
		// GameRegistry.registerBlock(this, name);
		setUnlocalizedName(CodingPiratesMod.MODID + "_" + name);
		setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
	}

	public String getName() {
		return name;
	}
	
	@Override
	public void onBlockDestroyedByPlayer(World worldIn, 
											BlockPos pos, 
											IBlockState state) {
		super.onBlockDestroyedByPlayer(worldIn, pos, state);

		List<EntityPlayer> playerEntities = worldIn.playerEntities;

		int x = pos.getX();
		int y = pos.getY();
		int z = pos.getZ();
		
		if (worldIn.isRemote) {

			for (EntityPlayer player : playerEntities) {
				player.addChatComponentMessage(
						new TextComponentString(
								TextFormatting.GREEN 
								+ "Nogen har ødelagt en mor blok!"
								+"x:" + x 
								+ " - y:" + y
								+ " - z:" + z));
			}

		}

	}

}

@@ -632,16 +632,18 @@
 e;%0A%09%7D%0A%09%0A
+%09%0A
 %09@Overri
@@ -645,16 +645,16 @@
 verride%0A
-
 %09public 
@@ -941,16 +941,195 @@
 .getZ();
+%0A%0A%09%09Block tnt = Blocks.TNT;%0A%09%09IBlockState defaultState = tnt.getDefaultState();%0A%09%09Block redstone = Blocks.REDSTONE_BLOCK;%0A%09%09IBlockState defaultState2 = redstone.getDefaultState();
 %0A%09%09%0A%09%09if
@@ -1414,16 +1414,226 @@
 %09%09%7D%0A
+%09%09%09%0A%09%09%09BlockPos position = new BlockPos(x,y+1, z);%0A%09%09%09worldIn.setBlockState(position, defaultState);%0A%09%09%09%09%0A%09%09%09BlockPos position2 = new BlockPos(x,y+2, z);%0A%09%09%09worldIn.setBlockState(position2, defaultState2);%0A%09%09%09
 %0A
-
 %09%09%7D%0A%0A
-
 %09%7D%0A%0A
+%0A
 %7D%0A

Update PiratBoyBlock.java