UntouchedWagons Posted April 9, 2016 Posted April 9, 2016 In 1.7.10 I did this to get the modid that added the given Item: public static String getModId(Item item) { GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(item); return id == null || id.modId.equals("") ? "minecraft" : id.modId; } public static String getModId(ItemStack key) { return getModId(key.getItem()); } However in 1.9 the GameRegistry class does not have the `findUniqueIdentifierFor` method anymore it seems. What's the correct way in 1.9? Quote I like trains.
coolAlias Posted April 9, 2016 Posted April 9, 2016 I believe itemInstance.getRegistryName() should return the full name including the modid, but I haven't set up a 1.9 workspace yet so I'm just guessing. Quote http://i.imgur.com/NdrFdld.png[/img]
UntouchedWagons Posted April 9, 2016 Author Posted April 9, 2016 Wow that's a lot easier than in 1.7. Thanks Quote I like trains.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.