Jump to content

NEED HELP Adding multiple blocks..


AssassinHero

Recommended Posts

I have added a block called nightium which has been put in

 

when I go to put the ore in I did this

 

@Mod(modid = "Parallel Worlds", name = "Parallel Worlds", version = "1.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class ParallelWorlds {

@SidedProxy(clientSide = "parallelworlds.client.ClientProxyParallelWorlds", serverSide = "parallelworlds.common.CommonProxyParallelWorlds")

public static ClientProxyParallelWorlds proxy = new ClientProxyParallelWorlds();

Block parallelworldsBlock;

int parallelworldsBlockID = 682;

@Init
public void load(FMLInitializationEvent event){
	parallelworldsBlock = new BlockParallelWorldsBlock(parallelworldsBlockID, 0, Material.iron).setUnlocalizedName("Nightium").setHardness(8.0F).setResistance(10000.0F).setStepSound(Block.soundStoneFootstep);
	gameRegisters();
	languageRegisters();
	proxy.registerRenders();
}


	public void gameRegisters(){
		GameRegistry.registerBlock(parallelworldsBlock);}

		public void languageRegisters(){

		LanguageRegistry.addName(parallelworldsBlock, "Nightium");

		}

		Block NightiumOre;

		int NightiumOreID = 681;

		@Init
		public void load1(FMLInitializationEvent event){
			NightiumOre = new BlockNightiumOre(NightiumOreID, 1, Material.iron).setUnlocalizedName("Nightium Ore").setHardness(8.0F).setResistance(100000.0F).setStepSound(Block.soundStoneFootstep).setLightValue(1.0F);
			gameRegisters();
			languageRegisters();
			proxy.registerRenders();

		}


		public void gameRegisters1(){
			GameRegistry.registerBlock(NightiumOre);
		}

		public void languageRegisters1(){

			LanguageRegistry.addName(NightiumOre, "NightiumOre");
		}



		}




 

 

This is my proxy

 

public class ClientProxyParallelWorlds extends CommonProxyParallelWorlds{

@Override
public void registerRenders() {
	MinecraftForgeClient.preloadTexture("/textures/blocks/Nightium.png");
	}

public void registerRenders1(){
	MinecraftForgeClient.preloadTexture("/textures/blocks/NightiumOre.png");
}
}

 

This is the BlockNightiumOre File

 

public class BlockNightiumOre extends Block{

public BlockNightiumOre(int id, int texture, Material mat){
	super(id, mat);
	this.setCreativeTab(CreativeTabs.tabBlock);


}


public String getTextureFile(){
	return "/parallelworlds/parallelworlds_Blocks_NightiumOre.png";
}




}

 

Any help?

 

P.s I know ore is different code to block slightly just wondering if anyone can highlight the mistakes :D

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

I do not understand what the question is.

 

As far as your post is concerned it has no errors so it's fine.

 

If your going to post an code without a error, how are we supposed to help you with an error?

 

The block isn't going into the game. I am trying to make an ore in minecraft but when i go into the creative tabs in-game the item doesn't exist

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

1. You need to make your Block variables public and static.

2. Your proxy declaration is a bit wrong. Look here on how to do it right: http://www.minecraftforge.net/wiki/Basic_Modding

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

1. You need to make your Block variables public and static.

2. Your proxy declaration is a bit wrong. Look here on how to do it right: http://www.minecraftforge.net/wiki/Basic_Modding

 

I followed the same code as previous and only nightium has appeared the ore hasn't. Any suggestions?

 

I'm new to making new blocks and ores

STOP CRUCIFYING NEW MODDERS!!!!

Link to comment
Share on other sites

1. You need to make your Block variables public and static.

2. Your proxy declaration is a bit wrong. Look here on how to do it right: http://www.minecraftforge.net/wiki/Basic_Modding

 

I followed the same code as previous and only nightium has appeared the ore hasn't. Any suggestions?

 

I'm new to making new blocks and ores

 

You mean in the creative tab? Either way, you made both block variables public and static as I said?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

1. You need to make your Block variables public and static.

2. Your proxy declaration is a bit wrong. Look here on how to do it right: http://www.minecraftforge.net/wiki/Basic_Modding

 

I followed the same code as previous and only nightium has appeared the ore hasn't. Any suggestions?

 

I'm new to making new blocks and ores

 

 

 

You mean in the creative tab? Either way, you made both block variables public and static as I said?

 

The ore isnt in the game at all. In the process now :)

STOP CRUCIFYING NEW MODDERS!!!!

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Your drivers are in a broken state, follow the guide in the FAQ: https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/#:~:text=How do I update my drivers%3F
    • A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc3fe22b60, pid=15228, tid=5140 # # JRE version: OpenJDK Runtime Environment Microsoft-8035246 (17.0.8+7) (build 17.0.8+7-LTS) # Java VM: OpenJDK 64-Bit Server VM Microsoft-8035246 (17.0.8+7-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) # Problematic frame: # C [atio6axx.dll+0x192b60] # # No core dump will be written. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # https://aka.ms/minecraftjavacrashes # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug i have no idea why please help
    • Quick-Books is great with regards to coordinating your monetary data. You can decide to live talk with a specialist at Quick-Books to get the answer for your questions. You will actually want to get to the talk going to the landing page and call us +1855-210-1428.
    • Update: I managed to make the item not disappear after crafting, but it doesn't remove any durability. import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.UnbreakingEnchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class NuggetHammer extends Item { private boolean damage; public NuggetHammer(Properties p_i48487_1_) { super(p_i48487_1_); } @Override public int getMaxDamage(ItemStack stack) { return 54 - 1; } public boolean isBarVisible(ItemStack stack) { return false; } @Override public ItemStack getContainerItem(ItemStack stack) { ItemStack copy = stack.copy(); copy.setCount(1); if (!this.damage) return copy; int unbreaking = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.UNBREAKING, stack); for (int i = 0; i < unbreaking; i++) { if (UnbreakingEnchantment.shouldIgnoreDurabilityDrop(stack, unbreaking, random)) return copy; } copy.setDamageValue(stack.getDamageValue() + 1); if (copy.getDamageValue() > stack.getMaxDamage()) return ItemStack.EMPTY; return copy; } }  
  • Topics

×
×
  • Create New...

Important Information

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