Jump to content

[SOLVED] [1.12.2] How to devide vanilla block with their variant


Recommended Posts

Posted (edited)

Hi.

 

I want to rename vanilla prismarine block.

In vanilla, prismarine's metadata is 1, prismarine bricks' metadata is 2, dark prismarine's metadata is 3.

I want to remove these metadata and rename them new block name such as prismarine -> "prismarine", prismarine bricks -> "prismarine_block", dark prismarine -> "dark_prismarine".

Anyone help me please.

 

I think I should override vanilla prismarine block, so I tried this code but error occoured.

@ObjectHolder(Reference.MODID)
public class HamaBlocks {
	@ObjectHolder("minecraft:prismarine")
	public static Block prismarine = null;
	@ObjectHolder("minecraft:prismarine_bricks")
	public static Block prismarineBricks = null;
	@ObjectHolder("minecraft:dark_prismarine")
	public static Block darkPrismarine = null;

	public static void onBlockRegister(RegistryEvent.Register<Block> event) {
		event.getRegistry().registerAll(//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "prismarine"))//
				.setUnlocalizedName("prismarine"),//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "prismarine_bricks"))//
				.setUnlocalizedName("prismarine_bricks"),//
				new Block(Material.ROCK).setCreativeTab(CreativeTabs.BUILDING_BLOCKS)//
				.setRegistryName(new ResourceLocation("minecraft", "dark_prismarine"))//
				.setUnlocalizedName("dark_prismarine")//
				);
	}
}
  Reveal hidden contents

 

Edited by K10
Posted

Thanks for your advice. I want to change not item name but registry name. Otherwise, I want to add variant as other 15 colored prismarine block.

In my ideal, my mod have "prismarine block" and "prismarine bricks block" and "colored prismarine block" registry name.

Posted (edited)

Thanks, I see.

 

However, How can I add other 15 prismarine metadata? Are there any way to add block metadata over 16? I thisk it is not able.

Do you have any idea for adding other 15 blocks in existing prismarine block?

Must I add block which has 15 other metadata in my mod?

Edited by K10

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.