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

I have another topic up currently concerning suppressing xp orbs from mobs (without supressing them from potions, mining, smelting, etc), without core mods. That isn't looking promising, so my next question is, if I do end up modifying EntityLiving.java from the net.minecraft.entity package (as below), what are the risks (or the downsides)? I assume that coremods replace core files with their own. If that is the case, I assume that any other mods that modify EntityLiving.java will be incompatible, and it will also be effecting any mods that inherit from EntityLiving.

 

I hate the idea of making my mod a core, but the xp orb suppression is a pretty big part of the mod.

 

EDIT: Sorry. I forgot to add the code. Probably not necessary for some of you guys, but this is it.

 

The code that I may have to modify is around line 690 of the net.minecraft.entity.EntityLiving class, in the onDeathUpdate Method.

Originally it was...

 

 

while (var1 > 0)
                    {
                        int var2 = EntityXPOrb.getXPSplit(var1);
                        var1 -= var2;
                        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2));
                    }

 

 

 

I am basically testing with pigs, so I am just wrapping the loop with a conditional if(!(this.getEntityName().equals("Pig") so that pigs will not drop xp orbs.

 

 

 

if(!(this.getEntityName().equals("Pig"))){
                	while (var1 > 0)
                    {
                        int var2 = EntityXPOrb.getXPSplit(var1);
                        var1 -= var2;
                        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2));
                    }
                }

 

 

I assume that coremods replace core files with their own.

no, they do not. they "just" modify its bytecode on-the-fly using ASM library.

 

http://asm.ow2.org/

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

  • Author

Thank you both. It looks like turning my mod into a coremod for this one simple function is a bit much (not that I know what is required), so I'm going to look into some more round-about ways to achieve this.

 

And thanks for the pointer. I hadn't considered my mods being public, but that is a better way to do the check anyway. Java and Strings are not the best company as resources go.

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.