Jump to content

Changing Food Eating Time


Mii1128

Recommended Posts

in your class extending itemFood, change the itemUseDuration thats wrong becase itemUseDuration is final

 

try making a class that extends Item and copy the code of ItemFood, call this class ItemFoodCustom or wtv and remove final from the itemUseDuration THEN try to make a class extends ItemFoodCustom and change the itemUseDuration

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Link to comment
Share on other sites

public StcmItemFood(int par1, int par2, float par3, boolean par4)

    {

        super(par1);

        this.itemUseDuration = 32;

        this.healAmount = par2;

        this.isWolfsFavoriteMeat = par4;

        this.saturationModifier = par3;

        this.setCreativeTab(CreativeTabs.tabFood);

    }

 

public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)

    {

        --par1ItemStack.stackSize;

        par3EntityPlayer.getFoodStats().addStats(this);

        par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F);

        this.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);

        return par1ItemStack;

    }

 

this is the problem when i hover over it sais :The method addStats(ItemFood) in the type FoodStats is not applicable for the arguments (StcmItemFood)

Link to comment
Share on other sites

do you know what this function do ?

 

 

that the function you call when you want to add +1 to the number of things this person has eaten... which honestly you dont care ... you could just remove it and it wouldnt affect the item (except that the game wont keep track of how many of this item you have eaten)

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

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



×
×
  • Create New...

Important Information

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