Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I've been working on a personal mod but I have a *very* basic understanding of Java, at this point in time I've been working on one issue for about 14 hours and have made no progress. I am trying to make a 'cube_column' block, but no idea where I'm going wrong.

 

RockPillar.class

Spoiler

package com.fetrien.elypsis.blocks;

import com.fetrien.elypsis.Main;
import com.fetrien.elypsis.init.ModBlocks;
import com.fetrien.elypsis.init.ModItems;
import com.fetrien.elypsis.util.IHasModel;

import net.minecraft.block.BlockRotatedPillar;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.util.EnumFacing;

public class RockPillars extends BlockRotatedPillar implements IHasModel {

    public RockPillars(String name, Material material) {
        super(material);
        setUnlocalizedName(name);
        setRegistryName(name);
        setHarvestLevel("axe", 0);
        setHardness(2.0F);
        setSoundType(SoundType.STONE);
        setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
        ModBlocks.BLOCKS.add(this);
        ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName()));
        this.setDefaultState(this.getDefaultState().withProperty(AXIS, EnumFacing.Axis.Y));
    }

    @Override
    public void registerModels() {
        Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory");
    }

}

modblocks.java (showing only parts that deal with block itself.)

Spoiler

import com.fetrien.elypsis.blocks.RockPillars;

 

public static final Block CROSS_STONE_BLOCK = new RockPillars("cross_stone_block", Material.ROCK);

Blockstates

Spoiler

{
    "variants": {
        "axis=y":  { "model": "em:cross_stone_block" },
        "axis=z":   { "model": "em:cross_stone_block", "x": 90 },
        "axis=x":   { "model": "em:cross_stone_block", "x": 90, "y": 90 },
        "axis=none": { "model": "em:cross_stone_block" }
    }
}

models/block.json

Spoiler

{
    "credit": "Model by Granny",
    "parent": "block/cube_column",
    "textures": {
        "end": "em:blocks/cross_stone_top",
        "side": "em:blocks/cross_stone_side"
    }
}

models/item.json

Spoiler

{
   "parent": "em:block/cross_stone_block",
 }

 

 

Error has been resolved, thanks everyone

Edited by Kaelym
(solved)

Well...

1) Your blockstate file does not contain an inventory variant

2) You didn't show your ModelRegistryEvent

 

Related: IHasModel is stupid and pointless (I will beat this out of you cargo cult programmers eventually). ALL items need models and all the information necessary to register a model is public. Code Style #3. Problematic Code #10.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Thank you, I will keep this in mind while I continue my mod.

Edited by Kaelym

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.