Jump to content

acecase

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

acecase's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. An update, in case anyone is looking at this for me. I have greped out all files in src/minecraft/net/minecraft that contain both XPOrb and spawn, and this is the result. So, I'm still lost. With a value of 0 for experienceValue, an EntityLiving should drop no xp orbs from what I can see.
  2. This is a repost of the last variation on my last post, but that one started as something totally different and noone is reading it anymore, so I am reposting the current issue. I am trying to stop xp orb drops from mobs and animals without effecting other things, like furnaces. I have created an event handler for the LivingDeath event and here is my code (simple enough to just explain but people like code) For some reason, beyond me, hostile mobs will not spawn xp orbs, but peaceful mobs still will. I looked at a pig's experienceValue before I set it to 0, and it is 0 by default, so they must be using a different system, but I traced the EntityPig class up the chain to the EntityLiving class, and I don't see where, other than EntityLiving, the pig could be inheriting the experienceValue property or any other method to drop xp orbs. Any help would be appriciated. This is the final piece to a mod I have been working on for a while. Thanks
  3. This actually does work, but it has a "bug?" or something. I tried it this way first, but it didn't suppress the orbs. I was testing it on pigs. It turns out, this works fine on hostile mobs, but not on passive mobs. It should work, as the EntityPig class extends the EntityAnimal class, which extends the EntityAgeable class, which extends the EntityCreature class, which extends the EntityLiving class, and EntityLiving class is where the method onDeathUpdate() exists, which is what spawns the EntityXPOrbs when mobs die. I haven't looked at all of these classes to see if something is being overridden or anything though. Just wanted to clarify that you were in fact correct. Thank you again.
  4. 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.
  5. 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... 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.
  6. Thank you again, but I had tried that, and it has no effect. XP orbs still spawn.
  7. Thank you. I can suppress all xp orbs easy enough within that event by checking that the name is "Experience Orb" and setting Event.setCanceled to true. The problem with this method is that I can't distinguish between a potion of enchanting, smelting xp, etc, and the mob dropped xp. Or at least I don't see a way. I was hoping there would be a way to see the source or dropping entity or something.
  8. After overcomplicating this thing several different ways, I see that I can simply set the experienceValue for the entity passed to my handler by the onLivingDeath event. This works for hostile mobs. Now I just need to figure out why it isn't working for passive mobs. EntityPig extends EntityAnimal extends EntityAgeable extends EntityCreature extends EntityLiving EntityLiving is where the method onDeathUpdate() exists, which is the method that spawns the EntityXPOrb, so I'm guessing one of these other classes is overriding something.
×
×
  • Create New...

Important Information

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