How to check for a armor id and or display name?

Started by Darth Feanor on Mon, 04/29/2019 - 01:11

Topic category: Help with MCreator modding

Last seen on 16:34, 13. Jun 2019
Joined Apr 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
How to check for a armor id and or display name?
Mon, 04/29/2019 - 01:11

So, I want to check for if a player is wearing a certain armor part, not with the normal box where you just select the item, I mean write in its id like "minecraft:diamond_helmet" can we do that somehow?

Last seen on 16:34, 13. Jun 2019
Joined Apr 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Alternitivly a way to get…
Mon, 04/29/2019 - 01:12

Alternitivly a way to get the display name of the armor worn in slot (whatever)

Last seen on 00:41, 16. Aug 2019
Joined Sep 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
To my knowledge, there is no…
Mon, 04/29/2019 - 02:54

To my knowledge, there is no way to find the ID of an item on an entity. If you want to find if they have armor on, or how much armor value an entity has, use the "Armor value of provided entity", located in the "Entity procedures" tab. Good luck on your searches!

Last seen on 17:40, 19. Sep 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Why do you need to type it…
Mon, 04/29/2019 - 14:49

Why do you need to type it in? What's wrong with selecting the item?

Last seen on 16:34, 13. Jun 2019
Joined Apr 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Because the armor I wish to…
Sat, 05/04/2019 - 23:11

Because the armor I wish to use is from another mod. So I want it to give a achivement for equiping my DR. Strange suit but am unable to find a way to do this with MCreator.

Last seen on 01:18, 19. Sep 2019
Joined Feb 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Dependencies allow you to do…
Sun, 05/05/2019 - 13:16

Dependencies allow you to do that... Though I don't know how to do that just yet myself as I'm soon going to test it out.

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Well, if you really want to,…
Sun, 05/05/2019 - 18:40

Well, if you really want to, you can get the ResourceLocation suing Item.REGISTRY.getNameForObject(item), convert the ResourceLocation to string and then compare the string to whatever you want, like this:

Item item = stack.getItem();
if(Item.REGISTRY.getNameForObject(item).toString().equals("minecraft:diamond_helmet")){
//do stuff here
}

 

Last seen on 16:34, 13. Jun 2019
Joined Apr 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
yeah... that kinda lost me…
Wed, 05/08/2019 - 18:08

yeah... that kinda lost me there. I get sorta the point but now the implimentation.

Last seen on 16:34, 13. Jun 2019
Joined Apr 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
not*  
Wed, 05/08/2019 - 18:09

not*