Jump to content

Recommended Posts

Posted
Java reflection is useful because it supports dynamic retrieval of information about classes and data structures by name, and allows for their manipulation within an executing Java program.

 

If you don't understand how that could be helpful, then you are probably copy / paste "modding"...

Posted

Java reflection is useful because it supports dynamic retrieval of information about classes and data structures by name, and allows for their manipulation within an executing Java program.

 

If you don't understand how that could be helpful, then you are probably copy / paste "modding"...

 

By not help me in this situation I mean it wont help me as I dont know how to use that to make vanilla blocks drop something. How do I use that in minecraft code?

Posted

took me 2 seconds of looking at RedstoneOre to find this...

    /**
     * Returns the ID of the items to drop on destruction.
     */
    public int idDropped(int par1, Random par2Random, int par3)
    {
        return Item.redstone.shiftedIndex;
    }

 

if dropping one of your mods blocks, replace

    {
        return Item.redstone.shiftedIndex;
    }

 

with...

 

    {
        return mod_XXXX.myItem.shiftedIndex;
    }

 

so as i said, its in Redstone ore...as an example

 

 

Posted

I was wondering if there was a way to make vanilla blocks drop items without editing the block file. In my case I want to make ice drop salt (from my mod) at a 1-10 chance without editing BlockIce, is there a way to do this?

Nope, not without editing base classes.

mca.png
Posted

took me 2 seconds of looking at RedstoneOre to find this...

    /**
     * Returns the ID of the items to drop on destruction.
     */
    public int idDropped(int par1, Random par2Random, int par3)
    {
        return Item.redstone.shiftedIndex;
    }

 

if dropping one of your mods blocks, replace

    {
        return Item.redstone.shiftedIndex;
    }

 

with...

 

    {
        return mod_XXXX.myItem.shiftedIndex;
    }

 

so as i said, its in Redstone ore...as an example

 

Did you read the topic name HOW TO ADD ITEM DROPS TO VANILLA BLOCKS WITHOUT EDITING BASE CLASSES LIKE MAKING ICE DROP SOMETHING WITHOUT EDITING BLOCKICE.JAVA

Posted

Alright just to shut up people

You cant

I want to add a hook for this but its very low on my priorities list right now.

People who are saying reflection, please stop being a dick and only say reflection when you are right.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

As above, I agree.

Maybe try to do something with a watcher class that checks the world for onBlockRemoval events, and then spawn the entity for salt.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

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.