I'm new to modding, but I have knowledge of relatively basic java a la APCS. I'm working on a mod for a school project of sorts and I've tried looking at several different tutorials for creating blocks and I've basically copy/pasted this basic block code.
package com.example.atm.blocks;
import com.example.atm.ATM_Mod;
import jdk.nashorn.internal.ir.Block;
import net.minecraft.block.material.Material;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ObjectHolder;
@Mod.EventBusSubscriber(modid = ATM_Mod.ID, bus = Mod.EventBusSubscriber.Bus.MOD)
@ObjectHolder(ATM_Mod.ID)
public class ATMBlock {
public static final Block ATM = null;
/**
* The actual event handler that registers the custom blocks.
*
* @param event The event this event handler handles
*/
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
//In here you pass in all block instances you want to register.
//Make sure you always set the registry name.
event.getRegistry().registerAll(
new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5).harvestLevel(2).harvestTool(ToolType.PICKAXE)).setRegistryName(ATM_Mod.ID, "atm")
);
}
}
However, the Block in RegistryEvent.Register<Block> says that it isnt within bound, and Properties of Block.Properties cannot be resolved. I cant see any difference between this and many other tutorials for basic blocks, can anyone help? I can find very few resources on 1.14.4 and the ones I do look about the same as what I have. I'm using JDK 1.8.0_231, forge 1.14.4-28.1.0 (the recommended version on the downloads page), and intellij 2019.2.