Jump to content

MOB HOLDING ITEMS AND MOB SPAWNING WITH ITEMS.


DARKHAWX

Recommended Posts

Hey guys just wondering what the code is for making my mob pick up items off the ground and what the code would be for my mob to spawn holding an item (I want it to spawn holding a sword). Any help will be appreciated.

 

P.S. I was also wondering if someone would explain what each section of the setRotationAngles does (what angle does it change):

 

 

 super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity);
          float var8 = MathHelper.sin(this.onGround * (float)Math.PI);
          float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI);
          this.bipedRightArm.rotateAngleZ = 0.0F;
          this.bipedLeftArm.rotateAngleZ = 0.0F;
          this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F);
          this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F;
          this.bipedRightArm.rotateAngleX = -((float)Math.PI / 4F);
          this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
          this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F;
          this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
          this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
          this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
          this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;

 

-DARKHAWX

No signature for you!

Link to comment
Share on other sites

Yeah i've tried that. Here is the code that I copied from the zombie but it still doesn't work. Can someone figure out what's wrong?

 

 public void initCreature()
{
 this.canPickUpLoot = true;
 this.setCurrentItemOrArmor(2, new ItemStack(Item.swordSteel));
}

No signature for you!

Link to comment
Share on other sites

I'm working a lot of overtime this week so I doubt I can do it tonight but if you havent solved the pickup issue or someone else has found an good answer for ya, I will try to make a mob pickup items to test how it works.

Have you tried extending the zombie class? then you're mob should be able to do all that a zombie does including picking up items.

Movespeed and all such variables is possible to change for your mob, so it could work...

 

 

PS: About the rotation, go into techne and adjust rotation on the 3 sliders below the texture offset.

There you should be able to see the effect of adjusting the X, Y and Z angle's. :)

 

If you guys dont get it.. then well ya.. try harder...

Link to comment
Share on other sites

Okay I tried that, still didn't fix it. It added more issues. My mobs act like zombies (on fire in sun, converting villagers). Then I decided to override those in my Entity file. But that just screwed everything up and still didn't fix it. So... You might have to look at the code, because I can't figure it out.

No signature for you!

Link to comment
Share on other sites

  • 4 weeks later...

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m
    • Discovering that a trusted colleague had accessed my Bitcoin account and transferred $30,000 worth of bitcoins was a devastating blow. It shattered the trust I had placed in them and left me feeling vulnerable and betrayed. However, in the face of adversity, I turned to MUYERN TRUST HACKER web [ ht tps:// muyerntrusthack.solutions/ ] for assistance in reclaiming control over my finances and holding the perpetrators accountable for their actions. One of the standout features of MUYERN TRUST HACKER was its ability to provide real-time alerts and notifications, keeping me informed every step of the way. With the support of MUYERN TRUST HACKER, I was able to gather irrefutable evidence of the perpetrator's actions and hold them accountable for their crimes. Armed with the information provided by the platform, I pursued legal recourse and ensured that justice was served. The perpetrator faced severe consequences for their actions, including legal penalties and financial restitution. Beyond its role in facilitating the recovery process, MUYERN TRUST HACKER provided me with a sense of empowerment and resilience in the face of adversity. While the experience was undoubtedly challenging, it ultimately served as a testament to the importance of vigilance and the power of technology in safeguarding our digital assets. Thanks to MUYERN TRUST HACKER, I emerged stronger and more resilient, ready to face whatever challenges the future may hold. Mail; muyerntrusted[At] mail-me .c o m  
    • Do you have still this problem? (I have it too so I want to know if you did something with it)  
    • Thank you very much, the mod worked. I almost destroyed my computer out of anger because I couldn't find the error.
  • Topics

×
×
  • Create New...

Important Information

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