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

Started by Darth Feanor on

Topic category: Help with Minecraft modding (Java Edition)

Active 5 years ago
Joined Apr 2019
Points:
774

User statistics:

  • Modifications: 1
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 47
How to check for a armor id and or display name?

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?

Active 5 years ago
Joined Apr 2019
Points:
774

User statistics:

  • Modifications: 1
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 47
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)

Active 1 month ago
Joined Sep 2018
Points:
1020

User statistics:

  • Modifications: 3
  • Forum topics: 48
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 163
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!

Active 4 years ago
Joined Jun 2016
Points:
1725

User statistics:

  • Modifications: 6
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1752
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?

Active 5 years ago
Joined Apr 2019
Points:
774

User statistics:

  • Modifications: 1
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 47
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.

Active 3 months ago
Joined Feb 2016
Points:
908

User statistics:

  • Modifications: 2
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 261
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.

Active 1 year ago
Joined Aug 2013
Points:
1162

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
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
}

 

Active 5 years ago
Joined Apr 2019
Points:
774

User statistics:

  • Modifications: 1
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 47
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.

Active 5 years ago
Joined Apr 2019
Points:
774

User statistics:

  • Modifications: 1
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 47
not*  
Wed, 05/08/2019 - 18:09

not*