Posted May 6, 201510 yr Hi, I have custom armor, and I want to 'test' wether a player wears custom made armor, and what parts of the armor that are weared. boots). Lets say I have an integer "armorWeared" of '0', and when the player wears a helmet we add 3 to "armorWeared", when the player wears boots, we add 1 to "armorWeared". Total: 4 And of course also, when the player takes of the helmet the total will be 1. How do I do this? Thanks. Creator of the Master Chef Mod and many more to come. If I helped you, please click the 'thank you' button.
May 6, 201510 yr Where do you need to calculate the 'armorWeared' value? It is easy, you can just add up them when it is needed in most case. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
May 6, 201510 yr It sounds like you just want to know if your player is wearing ALL of the pieces at once to then do something, no? In that case, whenever you want to do that special thing, simply check each piece of worn equipment on the player: ItemStack helm = player.getCurrentArmor(3); // etc. for each piece, then check each: if (helm != null && helm.getItem() == YourMod.yourCustomHelm && // etc., all the other pieces) { // do your special thing here } If, for whatever reason, you actually need to know which specific parts of your custom armor are being worn at all times without manually checking the player's armor slots all the time (which isn't really that big of a deal), then I recommend storing that information in IExtendedEntityProperties, but you really have to ask yoursef: "Why do I need this information, and why is the current method of getting that information not sufficient for my needs?" In 99% of cases, you will find that the current methods (see above) are more than sufficient. http://i.imgur.com/NdrFdld.png[/img]
May 6, 201510 yr Author Thanks. Creator of the Master Chef Mod and many more to come. If I helped you, please click the 'thank you' button.
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.