Jump to content

[1.9] Block dropping item


headstack

Recommended Posts

I am currently trying to update a mod from 1.8 to 1.9, and in the process I saw that the method for making a block drop a custom item isn't working. The method I am using is just plainly overriding the quantityDropped and getItemDropped functions from the Block class and making them return variables I have predefined in my custom block class.

 

    private int dropamountmax;
    private Item dropsOnHarvest;

    @Override
    public int quantityDropped(Random random) {
        return dropamountmax;
    }

    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune) {
        return dropsOnHarvest;
    }

 

Now, instead of dropping the Item dropsOnHarvest, it drops nothing when I break it with the correct tools and harvest level. Is there anything I might've missed in doing so?

Link to comment
Share on other sites

I am currently trying to update a mod from 1.8 to 1.9, and in the process I saw that the method for making a block drop a custom item isn't working. The method I am using is just plainly overriding the quantityDropped and getItemDropped functions from the Block class and making them return variables I have predefined in my custom block class.

 

    private int dropamountmax;
    private Item dropsOnHarvest;

    @Override
    public int quantityDropped(Random random) {
        return dropamountmax;
    }

    @Override
    public Item getItemDropped(IBlockState state, Random rand, int fortune) {
        return dropsOnHarvest;
    }

 

Now, instead of dropping the Item dropsOnHarvest, it drops nothing when I break it with the correct tools and harvest level. Is there anything I might've missed in doing so?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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