You’d have to know some information of the ItemType, specifically, you could easily figure out what sort of values the ItemStack has with Data API’s methods: getValues() which you could easily filter the values that are any instances of ListValue or even CollectionValue. The point is: All you gain with the magic number system is ambiguity of “what does this number actually mean?” If you wanted the durability, easily use the Keys.DURABILITY of which you can get the maximum allowed durability and minimum allowed durability, etc. For actual variants like from ItemTypes.DYE, you can get the Keys.DYE_COLOR from the ItemStack. Anything else that I’m missing?
2 Likes