Jump to content

[1.16.2] Custom Slabs


Jackson Lambert

Recommended Posts

I am new to modding, and was attempting to create custom blocks. I am able to create the blocks, but am having a lot of trouble creating the slabs and stairs. I cant find a tutorial that goes through all the steps, and the ones i do find are outdated. If someone could help me with this, that would be great. Thanks.

Please do not get mad at me. I am new to Forge modding. Thanks.

Link to comment
Share on other sites

IIRC you shouldn't even need to extend the vanilla Slab or Stair block class, you should be able to create your own just by passing in parameter data.

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.

Link to comment
Share on other sites

If you aren't doing anything that is going to be "custom" to the slab, you could just directly use the constructor from the class and pass in some params (as what Draco18s said). That would be much simpler and easier to read. If you wanted to change how certain functions and methods work in the slab, you would have to extend the class. 

Link to comment
Share on other sites

I've got the slab class done, but I can't seem to figure out the ForgeRegistries for it. I've got this,

public static DeferredRegister<SlabBlock> SLABS = DeferredRegister.create(ForgeRegistries.???????, .MorePolishedBlocks.MOD_ID);

but can't find a class under ForgeRegistries that would make sense.

 

Also, thanks for telling me about the SlabBlock class.

Again, I'm new to this.

Please do not get mad at me. I am new to Forge modding. Thanks.

Link to comment
Share on other sites

....ForgeRegistries.BLOCKS?

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.

Link to comment
Share on other sites

When i attempt to create (I used TestBlockSlab as a placeholde) :

public static final RegistryObject<SlabBlock> TEST_BLOCK_SLAB = BLOCKS.register("test_block_slab", TestBlockSlab::new);

It gives me this error: 

Inferred type 'I' for type parameter 'I' is not within its bound; Should extend 'net.minecraft.block.Block'

 

Am i missing something?

Edited by Jackson Lambert

Please do not get mad at me. I am new to Forge modding. Thanks.

Link to comment
Share on other sites

1 hour ago, Jackson Lambert said:

TestBlockSlab

And does this class extend anything? If so, what?

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.

Link to comment
Share on other sites

1 hour ago, Jackson Lambert said:

RegistryObject<SlabBlock>

I think the error means this part, then. Change from <SlabBlock> to <Block>

  • Thanks 1

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.

Link to comment
Share on other sites

  • 2 months later...
2 hours ago, trashraccoon42 said:

You willing to share what the problem was/how you fixed it?

Not to necro a dead thread, but the easiest way to do this if you're simply just making a slab that does nothing but be a slab would just register it as such.

    public static final RegistryObject<Block> CUSTOM_SLAB = CUSTOM_BLOCKS.register("custom_slab", () -> new SlabBlock(properties));

where CUSTOM_BLOCKS is your DeferredRegister for your blocks and properties are whatever properties (hardness/material/etc.) you want your slab to integrate.

Edited by ModMCdl

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

Link to comment
Share on other sites

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.

×
×
  • Create New...

Important Information

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