instead of event.getRegistry().register(new BlockItem(ModBlocks.FIRSTBLOCK, new Item.Properties()).setRegistryName("firstblock")); use event.getRegistry().register(new BlockItem(ModBlocks.FIRSTBLOCK, new Item.Properties()).setRegistryName(ModBlocks.FIRSTBLOCK.getRegistryName()));
This eliminates the chance of getting the registry name wrong.
Change your ModBlocks class from
public class ModBlocks {
@ObjectHolder("mytutorial:firstblock")
public static FirstBlock FIRSTBLOCK;
}
to
@ObjectHolder(ColoredTorches.modid)
public class ModBlocks {
public static final FirstBlock FIRSTBLOCK = null;
}
You're game is currently crashing because ModBlocks.FIRSTBLOCK is null. It is null because you've hardcoded the name of the block to "mytutorial:firstblock" when it should be "coloredtorches:firstblock". This means that the field never gets filled with your block, and you're item block tries to use a null block in getTranslationKey, causing a crash. Putting @ObjectHolder on your class with your modid means that you don't need to hardcode each name above each field, instead the name of the object is gotten with yourModId + ":" + nameOfField.