Jump to content

Recommended Posts

Posted

I decided to create a new thread for this because its a different problem.

 

I am making a mob grinder that uses a fake player to do the killing and for the most part it works fine but but i am having problems when other mods try to do certain things to it (in this case the other mod is Infernal Mobs). At first i had a problem when an infernal mob tried to affect the fake player with a potion effect but i have since fixed that now i am having trouble when a mob tries sent a data packet to the fake player.

 

I have tracked the problem to playerNetServerHandler in my fake player is null which is giving a null pointer exception in FMLOutboundHandler.

 

Crash log

 

  Reveal hidden contents

 

 

Unfortunately finding the problem was the easy part i have been working on this for over a day and havent even come close to finding a solution yet. Im hoping someone more experienced can help me with this problem.

I am the author of Draconic Evolution

Posted

Last I checked you don't need a fakeplayer to make mobs drop their rare-drops.  There is (was) an int field you can set in the entity that denotes a timer since it was last hit by a player.  If this timer>0 when it dies, it drops rare/player only loot.  Simply set the timer to 1, and do whatever to kill the entity (I generally call entity.attackEntityFrom(genericSource, entityHealth).

 

 

Upon further investigation, the field is still there, in EntityLivingBase.

 

protected int recentlyHit;

 

Use reflection / AT to set this to a value >0.  Viola, the mob now drops 'rare' loot.

 

 

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.