Jump to content

Recommended Posts

Posted

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.

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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