Jump to content

Is addRandomArmor() or dropRareDrop() present in Forge 1.8.9?


Recommended Posts

Posted

Greetings,

 

I have a working mod for Forge 1.8-11.14.4.1577.  The mod overrides addRandomArmor() as shown in the following code excerpt.

 

public class MyMob extends net.minecraft.entity.monster.EntityMob
{
  private net.minecraft.item.Item rareItem;

  public MyMob(net.minecraft.world.World world, net.minecraft.item.Item rareItem)
  {
    super(world);
    this.rareItem = rareItem;
  }

  @Override
  protected void addRandomArmor()
  {
    this.dropItem(rareItem, 1);
  }
}

 

I want to migrate this mod to Forge 1.8.9-11.15.1.1722.  I took the documented steps to upgrade the project.  After the upgrade I found that addRandomArmor() method does not seem to be a part of EntityMob anymore.

 

I went through the normal intuitive search into the Minecraft source, looking for how best to handle this problem.  I didn't find an answer so I moved on to search this forum and eventually Google.  Google found for me that addRandomArmor() is misleading and that the correct method name might be dropRareDrop().  That better represents how I am using addRandomArmor(), but dropRareDrop() is not present either.

 

I made a guess when I moved my code to net.minecraft.entity.EntityLivingBase#onDeathUpdate(), but that did not seem to work correctly.

 

I decided I lack sufficient familiarity with the Minecraft source to find the best solution within a reasonable amount time.  What would you recommend?

 

- Thank you for your time.

A software engineer’s job is often to condense fact from the nuance of vapor.

Posted
MCPBot tells me that
EntityLivingBase#addRandomArmor

(

func_82164_bB

) was renamed to

EntityLivingBase#addRandomDrop

on 2015-02-02 (in 1.8). It still has this name in 1.8.9, but the method was removed in 1.9.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.