Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.