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

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 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 ?

  • Author

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

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-

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...

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.