Jump to content

Custom Ore


bhavikchugani

Recommended Posts

I have created an ore block which i want to make it spawn randomly below a certain level in the ground. Can someone help me solve this. Using 1.11.2 Forge..

One More issue. I am having trouble with the ore material as it aint working. I have zipped the files and attached below can someone check to see what the error is I tried for an hour to find it

main.zip

Edited by bhavikchugani
Addon file plus
Link to comment
Share on other sites

Best thing to do is upload your code to a github repository, it's much easier for people to see when you do so. It's free, and quite helpful. http://www.github.com

 

For ore generation, I just went to google and typed in "minecraft forge 1.11.2 ore generation". You basically need to implement an IWorldGenerator.

http://www.minecraftforge.net/forum/topic/53563-111-world-generation/

looks like it has some info you could use.

 

  • Like 2
Link to comment
Share on other sites

17 minutes ago, V0idWa1k3r said:

Define 'material not working'. Is the mining tool incorrect? The map color? Piston movement? There are a few things that materials control.

In addition to @Ugdhar's answer - do not forget to register your IWorldGenerator implementation with GameRegistry::registerWorldGenerator

What is happening is that the material is not loading when i place it and it is just the default purple-black checkered texture.

i copied the same code as another block i created and just changed the names.

the material only shows up on the toolbar and not when i place

And @Ugdhar how exactly should i post it the main folder or just its contents??

Link to comment
Share on other sites

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    public static final Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates file is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

Edited by V0idWa1k3r
Clarified N6
  • Like 1
Link to comment
Share on other sites

8 minutes ago, V0idWa1k3r said:

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    
    public static Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates variant is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

I used the same json for my 1st block and it worked and do i move the whole code 

public static void registerRenders(){
		registerRender(rubyblock);
		registerRender(rubyore);
	}

to client Proxy???

 

Link to comment
Share on other sites

10 minutes ago, V0idWa1k3r said:

That is not a material but a model issue. Make sure that your model is correct - you can follow this guide 

Okay, looking at your sourcecode:

  1. Please, never use ItemModelMesher. It leads to numerous bugs and issues. There is a ModelLoader class for registering your models.
  2. You should move everything rendering registry related into your client proxy.
  3. Models for blocks/items must be registered during pre-init, not init.
  4. Your blocks/items should be statically initialized. There is no need to call the init method. Simply write 
    
    public static Block rubyblock = new BlockRuby();


     

  5. I believe that your blockstates variant is not correct. I have provided a link to a tutorial on how to make those.

  6. Your model JSON file is invalid. It is missing an opening bracket

And also what is the replacement code for ItemMesher?

Link to comment
Share on other sites

Just now, V0idWa1k3r said:

Just move model registering to a client proxy.

A replacement for ItemModelMesher is ModelLoader.

The model file for the ruby block is indeed correct. It is not correct for the ore block.

just changed it running it right now! Worked! Its so irritating that how one letter or symbol makes a huge impact thnx @V0idWa1k3r

Link to comment
Share on other sites

Create a class that implemets IWorldGenerator. the generate method is the one that will get called each time a new chunk is generated. The parameter names in that method have pretty self-explanatory names so you should understand what each of them means. When you are done wrighting generation code in the generate method register an instance of the class you've just made with  GameRegistry::registerWorldGenerator(yourGeneratorClassInstance, weight) where weight determines the order your generator is executed relative to other mods generators. The bigger the number the later your generation will be executed.

This is an example I found in ~5 minutes.

Edited by V0idWa1k3r
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Falling victim to a scam is a distressing reality many face. I found myself in such a predicament not too long ago, having invested a significant amount of money in what I believed to be a promising platform, only to discover it was nothing more than a fraudulent scheme. The devastating realization that my hard-earned funds had vanished and left me feeling helpless and vulnerable until I found a glimmer of hope in the form of TECHNOCRATE RECOVERY. Discovering TECHNOCRATE RECOVERY felt like stumbling upon a lifeline amidst the turbulent sea of financial fraud. Their reputation as a remarkable team of professionals specializing in assisting individuals in recovering funds lost to scams preceded them, offering a ray of hope in my darkest hour. With trepidation and a flicker of optimism, I reached out to them, hoping against hope for a chance at redemption. From the very first interaction, TECHNOCRATE RECOVERY proved themselves to be true lifesavers. Their compassion, professionalism, and unwavering dedication to my cause were evident from the outset, instilling a sense of trust and reassurance in their abilities. They wasted no time in springing into action, meticulously gathering the necessary information, and laying out a strategic plan for the recovery process. What followed was nothing short of miraculous. With precision and expertise, TECHNOCRATE RECOVERY navigated the complexities of cryptocurrency scams, uncovering the deceit and reclaiming what was rightfully mine. MAIL BOX: Technocratrecovery(@)contractor(.)net   WEBSITE INFO: www (.)technocraterecovery(.)site
    • Hello, I have been suffering with consistent crashes either during load up or during play-time. I have updated all drivers, updated and reinstalled java versions, and tried curseforge, GDLauncher, and PrismLauncher. I am struggling to find the issue of the crash as it is inhibiting me from playing. Please help, thanks. https://pastebin.com/GnQHr6sZ https://pastebin.com/6EyR1Sgk
    • Hello, I am trying to join a server with mods, specifically a Custom Profile Modpack I made. I have no idea how to identify the problem, please help. I attached the error, Modpack, and the Crash Report it gave me. Mods: https://ibb.co/N7p6Pgr Modpack: https://drive.google.com/file/d/1KCEyq_sGAF9q7tilKbdGOubpKeUdHRHx/view?usp=sharing Minecraft Crash Report: https://paste.ee/p/zISCN Minecraft Launcher Error Image: https://ibb.co/sbwQRb4
    • Thanks for the response. I ended up going with this:   public class PlayerDeathHandler { @SubscribeEvent public void playerKilled(LivingDeathEvent event) { if (event.getEntity() instanceof Player player) { ItemStack poppetStack = new ItemStack(ModItems.DEATH_PROTECTION_POPPET.get()); if (player.getInventory().contains(poppetStack)) { event.setCanceled(true); player.setHealth(player.getMaxHealth()); for (int i = 0; i < player.getInventory().getContainerSize(); i++) { ItemStack stackInSlot = player.getInventory().getItem(i); if (stackInSlot.getItem() == poppetStack.getItem()) { stackInSlot.shrink(1); if (stackInSlot.isEmpty()) { player.getInventory().setItem(i, ItemStack.EMPTY); } break; } } } } } } It works like a charm, but are there any issues that COULD arise using this? I don't have much experience with Forge, so I'm not sure about the common issues and whatnot.
  • Topics

×
×
  • Create New...

Important Information

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