Jump to content

Recommended Posts

Posted

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?

 

Posted

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.

Posted

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.

Posted

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?

Posted

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?

 

 

 

 

 

Posted

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.

Posted

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.

Posted

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.

Posted

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

 

Posted

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.

Posted

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)));

    }

}

 

Posted
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.

Posted

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.

 

 

Posted

[[[ 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);

 

 

Posted

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.

Posted

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.

  • 1 year later...
Posted
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.

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

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

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