Jump to content

Recommended Posts

Posted

What is the new code to add an effect to the player if a full set of armor is equipped . Also how could I make a double jump effect(while im in the air I can hump one more time)?

Posted

What is the new code to add an effect to the player if a full set of armor is equipped . Also how could I make a double jump effect(while im in the air I can hump one more time)?

What is the old code ?

Posted

It was

public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemstack)
{
	ItemStack boots = player.getCurrentItemOrArmor(1);
	ItemStack legs = player.getCurrentItemOrArmor(2);
	ItemStack chest = player.getCurrentItemOrArmor(3);
	ItemStack helmet = player.getCurrentItemOrArmor(4);

	if(boots != null && legs != null && chest != null && helmet != null)
	{
		if(boots.getItem() == ModClass.boots.itemID && legs.getItem() == ModClass.legs.itemID &&
				chest.getItem() == ModClass.chest.itemID && helmet.getItem() == ModClass.helmet.itemID)
		{
			//put the effect and stuff here
		}
	}
}

 

Now it gives an error that I can't have an int and item

Posted
helmet.getItem() == ModClass.helmet.itemID

yeah... thsi makes no sens, this is literally the equivalent of comparing apples and hammers. To the eyes of the compiler this statement makes no sens.

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Posted

Shouldn't you just get the itemID of the current worn boots, helmets etc and compare those with the itemID's of the armor id's which have the special effect? I have not tried to but i am not sure if theres a .getItemID for items. Otherwise you will have to find a different way to get the items ID. Perhaps you can even use boots.itemID.

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.