Jump to content

1.11.2 Creating custom Ore. [SOLVED]


DavidSullivan

Recommended Posts

New to this so bare with me please.

I am now making blocks no problem but I want to make a custom ore.

I can see there is a class BlockOre.

One would think that all ores drop metals so why don't they have a setItemDropped or SetOreDropped function?

Or am I missing something.

Do I really have to extend and override to return the idDropped?

 

If so what is the point of BlockOre?

 

Link to comment
Share on other sites

Because vanilla ore blocks drop themselves, which is handled by the super class,

Block

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

David what exactly are you looking to do?

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

I'm designing my first mod. I figure in order to build the stuff in my mod I will need some custom ores.

Figured I should add a copper ore, which would smelt to Copper_Ingots

 

then I could use those those in recipes to build custom engines and such in the future.

 

If Im reading this correct I simply extend the BlockOre and

 

@overide

public Item getItemDropped(IBlockState state, Random rand, int fortune)

 

 

or is this an old way of doing it?

Link to comment
Share on other sites

OK. I can make blocks and declare things like

 

cheese = new ItemFood(...

 

and I understand this gives said Item certain properties that make it act like food.

I can't find one that looks obvious like ItemOre or ItemMetal.

Is there one that makes it able to be melted in the forge?

 

 

 

 

 

Link to comment
Share on other sites

I'm designing my first mod. I figure in order to build the stuff in my mod I will need some custom ores.

Figured I should add a copper ore, which would smelt to Copper_Ingots

 

then I could use those those in recipes to build custom engines and such in the future.

 

If Im reading this correct I simply extend the BlockOre and

 

@overide

public Item getItemDropped(IBlockState state, Random rand, int fortune)

 

 

or is this an old way of doing it?

 

If you're looking to have a block that when destroyed it drops itself, do nothing. If you want this "Copper Ore" to drop "Copper Ingot" when destroyed, use

		this.getItemDropped(state, rand, fortune)

in the block class itself.

 

Is that right diesieben07?

 

 

 

OK. I can make blocks and declare things like

 

cheese = new ItemFood(...

 

and I understand this gives said Item certain properties that make it act like food.

I can't find one that looks obvious like ItemOre or ItemMetal.

Is there one that makes it able to be melted in the forge?

 

If you want a smelting recipe, you need to use GameRegistry.addSmelting in the init.

 

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

This seems like a really common task for most modders

has anyone ever created a custom ore and do you have a code example that will simplify this.

 

If not I will figure it out and post one eventually.

 

If you want example code for an ore, look in my signature for my GitHub on TeamMadness Mod, I made many ores there.

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

If you want a smelting recipe, you need to use GameRegistry.addSmelting in the init.
preInit.

 

Oh, I use my smelting and crafting recipes in the init. Sorry

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

These are great comments everyone thanks you. So taking different bits.

I made a normal block called copperBlock

in the language pack I called it Copper Ore.

 

when destroyed it drops a block of copper ore.

 

Then I added

 

GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

 

just to test it. cheese is a custom Item I added earlier.

 

now when I put the copper in the furnace it wont burn.

 

what am I missing

 

Link to comment
Share on other sites

Well, we don't have access to all of your code. Care to post any of it so we can actually help you?

I Love To Help People. Unless They Are The Kind Of People Who Just Doesn't Know Anything. Those People Need Some Serious Help. This Could Help But......

https://www.youtube.com/watch?v=6t0GlXWx_PY

 

ThingsMod Git: https://github.com/EscapeMC/Things-Mod-1.10.2

 

TeamMadness Mod Git: https://github.com/EscapeMC/TeamMadness-Mod-1.10.2

 

If I somehow help you, please click the "Thank You" button. If I am a total waste of time, please click the "Applaud" button.

Link to comment
Share on other sites

Sure I'll start with this and you tell me if you need more.

 

package me.DSul.SullyModPack.Init;

 

import me.DSul.SullyModPack.ModInfo;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockOre;

import net.minecraft.block.material.MapColor;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.block.model.ModelResourceLocation;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemBlock;

import net.minecraft.item.ItemStack;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.client.model.ModelLoader;

import net.minecraftforge.fml.common.registry.GameRegistry;

 

 

 

/**

* Created by ManLand-PC on 1/19/2017.

*/

public class ModBlocks {

 

    public static Block cheeseBlock;

    public static Block copperBlock;

 

    public static void init(){

        cheeseBlock = new Block(Material.SPONGE).setUnlocalizedName("cheeseblock").setCreativeTab(CreativeTabs.DECORATIONS);

        copperBlock = new Block(Material.IRON).setUnlocalizedName("copperblock").setCreativeTab(CreativeTabs.DECORATIONS);

        copperBlock.setHardness(2f);

        GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

       

 

 

 

    }

    public static void registerBlocks(){

        registerBlock(cheeseBlock);

        registerBlock(copperBlock);

 

    }

    public static void registerRenders(){

        registerRender(cheeseBlock);

        registerRender(copperBlock);

 

    }

    public static void registerRender(Block block){

        Item item = Item.getItemFromBlock(block);

        ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(ModInfo.MOD_ID + ":" + item.getUnlocalizedName().substring(5), "inventory"));

 

    }

    public static void registerBlock(Block block){

        GameRegistry.register(block, new ResourceLocation(ModInfo.MOD_ID, block.getUnlocalizedName().substring(5)));

        GameRegistry.register(new ItemBlock(block), new ResourceLocation(ModInfo.MOD_ID, block.getUnlocalizedName().substring(5)));

    }

}

 

Link to comment
Share on other sites

GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

 

By the way, "3.0" there isn't any different than "1.0"

The number is the "probability that the furnace will drop 1 experience per item smelted."  A value greater than 1 is treated as 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

I found the problem.

 

***

I was GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

 

before I even registered the blocks.

 

Moved it to the end of

 

public static void registerBlocks(){

        registerBlock(cheeseBlock);

        registerBlock(copperBlock);

 

        GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

 

    }

 

and now it works.

 

 

Link to comment
Share on other sites

[[[ SOLVED ]]]

 

super easy to make custom ore blocks.

 

just create a normal block with your ore name then after registeringItems and registeringBlocks

--> so the game knows what you are working with

 

use

 

        GameRegistry.addSmelting(copperBlock, new ItemStack(ModItems.cheese, 2), 3F);

 

 

Link to comment
Share on other sites

Cough. [nobbc][nobbc][/nobbc] is a thing, guys.

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

It is a tag that prevents BBcode inside it from being parsed.

 

Watch.

 

[nobbc]This sentence is rendered as is[/nobbc]

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 year later...
8 minutes ago, supreme marshal said:

I have the same problem, I created some custom block but when I create a Smelting Recipe, the block won't burn in the furnace. But I couldn't fix my problem like you did. 

This thread is a year old, if it didn't solve your problem start a new thread which contains all relevant info, such as your code and any errors.

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

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

    • Hello! I have recently purchased a new computer and cannot download Optifine or Forge. The issue I am having is that the Java program 'javaw.exe' does not seem to open .jar files for me. As far as I can tell, I cannot open .jar files at all. The trouble-shooting I have tried so far is that I have un-downloaded and re-downloaded Java and that has not fixed it. I have followed the pathway to 'open with->choose another app->choose an app on your pc->Program Files (x86)->Java->jre-1.8->bin. and from inside bin I have tried opening these programs with each and every java application in there assuming I may have been wrong about which one I need to use. Still no luck. From there I checked to make sure that Java was allowed through my firewall and have seen no instances of any application with Java in the name anywhere in the list of apps to let through fire wall. I'm unsure of what to try next, so I would absolutely love help figuring out why my computer is not letting me open .jar files. Specifically these ones that I know are meant to open as installers. Any ideas are appreciated. Thanks in advance!
    • Thanks again for your anwsers, I tested without practical_plushies_mobs, practical_plushies_animals and dark-waters and now red forge loading screen appears however few seconds later it crashed again.  How I could put my file codes in my minecraft folder? log crash report
    • I have a modded mob that when I try to spawn it, it won't spawn and a crash happens (doesn't crash whole game though) and it says "Duplicate id value for 16!" and points to the mob's defineSynchedData method. Anyone know what's going on? Here's the method it was pointing to: @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(MY_BOOLEAN_DATA, false); }  
    • Click Here -- Official Website -- Order Now ➡️● For Order Official Website - https://sale365day.com/get-restore-cbd-gummies ➡️● Item Name: — Restore CBD Gummies ➡️● Ingredients: — All Natural ➡️● Incidental Effects: — NA ➡️● Accessibility: — Online ✅HUGE DISCOUNT ! HURRY UP! ORDER NOW!✅ ✅HUGE DISCOUNT ! HURRY UP! ORDER NOW!✅ ✅HUGE DISCOUNT ! HURRY UP! ORDER NOW!✅   Restore CBD Gummies is a strong contender for the top gummy of the year. Due to its strong concentration of CBD and purity, you will achieve excellent results while using it if you stick with this solution. Most people who suffer from constant pain, anxiety, depression, and insomnia are currently solving these problems, and you can be the next one. All you need to do is give Restore CBD Gummies a chance and let this fantastic product change your life. Visit the official website to order your Restore CBD Gummies today! After reading Restore CBD Gummies reviews, we now know that knee replacement surgeries are not the only option to treat knee pain, inflammation, joint discomfort, and stiffness. These CBD gummies can heal your joints and provide you relief from pain and stress so that you can lead a happy life. Prosper Wellness Restore CBD Gummies can improve joint mobility and improve knee health so that you can remain healthy. Exclusive Details: *Restore CBD Gummies* Read More Details on Official Website #USA! https://www.facebook.com/claritox.pro.unitedstates https://www.facebook.com/illudermaUCAAU https://www.facebook.com/awakenxtusa https://groups.google.com/a/chromium.org/g/chromium-reviews/c/8NMUVKgd-FA https://groups.google.com/g/microsoft.public.project/c/0UZQQKOZF58 https://groups.google.com/g/comp.editors/c/r_BcRRrvGhs https://medium.com/@illuderma/illuderma-reviews-fda-approved-breakthrough-or-clever-skincare-scam-36088ae82c3e https://medium.com/@claritoxpros/claritox-pro-reviews-legitimate-or-deceptive-dr-warns-of-potential-dangers-d5ff3867b34d https://medium.com/@thedetoxall17/detoxall-17-reviews-scam-alert-or-legit-detox-solution-customer-report-inside-1fd4c6920c9e https://groups.google.com/a/chromium.org/g/chromium-reviews/c/RONgLAl6vwM https://groups.google.com/g/microsoft.public.project/c/TgtOMRFt6nQ https://groups.google.com/g/comp.editors/c/fUfg0L2YfzU https://crediblehealths.blogspot.com/2023/12/revitalize-with-restore-cbd-gummies.html https://community.weddingwire.in/forum/restore-cbd-gummies-uncovered-fda-approved-breakthrough-or-deceptive-wellness-scam--t206896 https://restorecbdgummies.bandcamp.com/album/restore-cbd-gummies-uncovered-fda-approved https://my-restore-cb.clubeo.com/page/restore-cbd-gummies-reviews-customer-alert-drs-warning-genuine-or-wellness-hoax.html https://my-restore-cb.clubeo.com/page/restore-cbd-gummies-reviews-scam-alert-or-legit-relief-solution-customer-report-inside.html https://medium.com/@restorecbdgum/restore-cbd-gummies-reviews-warning-2023-update-real-or-a-powerful-relief-hoax-caution-350b61472a3f https://devfolio.co/@restorecbdgum https://restore-cbd-gummies-9.jimdosite.com/ https://devfolio.co/project/new/restore-cbd-gummies-reviews-scam-or-legit-custo-7bd6 https://groups.google.com/a/chromium.org/g/chromium-reviews/c/R0enUCvfs8s https://groups.google.com/g/microsoft.public.project/c/miJma2yOMDQ https://groups.google.com/g/comp.os.vms/c/S_HG94aaKFo https://groups.google.com/g/mozilla.dev.platform/c/qb6WpMUYLu0 https://hellobiz.in/restore-cbd-gummies-reviews-warning-2023-update-genuine-wellness-or-another-hoax-caution-211948390 https://pdfhost.io/v/ir5l.cseV_Restore_CBD_Gummies_Reviews_WARNING_2023_Update_Genuine_Wellness_or_Another_Hoax_Caution https://odoe.powerappsportals.us/en-US/forums/general-discussion/7c8b3f62-6d96-ee11-a81c-001dd8066f2b https://gamma.app/public/Restore-CBD-Gummies-ssh57nprs2l6xgq https://restorecbdgummies.quora.com/ https://www.facebook.com/RestoreCBDGummiesUS https://groups.google.com/g/restorecbdgum/c/9KHVNp3oy3E https://sites.google.com/view/restorecbdgummiesreviewsfdaapp/home https://experiment.com/projects/pjyhtzvpcvllopsglcph/methods https://lookerstudio.google.com/reporting/e5e9f52d-ae52-4c84-96c6-96b97932215f/page/XtkkD https://restore-cbd-gummies-reviews-is-it-a-sca.webflow.io/ https://colab.research.google.com/drive/1xZoc6E2H-jliBSZRVl0vnVqrkc3ix4YU https://soundcloud.com/restore-cbd-gummies-821066674/restore-cbd-gummies https://www.eventcreate.com/e/restore-cbd-gummies-reviews https://restorecbdgummies.godaddysites.com/ https://sketchfab.com/3d-models/restore-cbd-gummies-reviews-fda-approved-7cfe1fb8b003481c81689dd9489d2812 https://www.scoop.it/topic/restore-cbd-gummies-by-restore-cbd-gummies-9 https://events.humanitix.com/restore-cbd-gummies https://communityforums.atmeta.com/t5/General-Development/Restore-CBD-Gummies/m-p/1113602
  • Topics

×
×
  • Create New...

Important Information

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