To create a block that is a tile entity, you first need a basic block. The code for the tile entity you create in this hour is as follows:
public static Block samTE;
In addition, add this code to the
samTE = new BlockSamTE();GameRegistry.registerBlock(samTE, "SamTE");
When you add this, an error should appear under
BlockSamTE, which you can fix by creating the file. After adding the
BlockSamTE class, cleaning it up a bit, and adding the most basic constructor to remove all of the errors, the class should look like Listing 12.1.
package com.wuppy.samsmod;import net.minecraft.block.Block;import net.minecraft.block.material.Material; ...