In Minecraft 1.12.2 various items have a ‘sub ID’ (I’m not sure of it’s actual name) which exist in addition to it’s full ID.
For example, andesite has the id minecraft:stone
but can be told apart from other stone blocks using it’s sub ID, which is 5. To give andesite to the player one runs /give CrashDive minecraft:stone 1 5
where 5
represents the sub ID fo andesite.
I’m aware that, for vanilla items, this value can be extracted using Key
s such as Keys.STONE_TYPE
Keys (SpongeAPI 7.2.0 API) . This is fine, but I need a generic way to find this information for any item, including modded ones. For example an ‘Electronic Circuit’ from IC2 Classic has the id ic2:itemmisc
and the sub ID 451
. If I have an ItemStack
of electronic circuits how do I obtain the subID (451)?
I’m using Sponge 7.2.0