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 modding (Java Edition)

Last seen on 21:28, 29. Mar 2020
Joined Apr 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 21:28, 29. Mar 2020
Joined Apr 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 08:12, 31. May 2020
Joined Sep 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 15:00, 5. Jun 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 21:28, 29. Mar 2020
Joined Apr 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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, 30. May 2020
Joined Feb 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 21:28, 29. Mar 2020
Joined Apr 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • Comments:
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 21:28, 29. Mar 2020
Joined Apr 2019
User points:

User statistics:

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

not*