Myxtro Posted May 19, 2022 Posted May 19, 2022 I'm looking for a way to get an array of all items with a certain tag. Is this possible? Minecraft version 1.18.2 Quote
CheIlia Posted January 12 Posted January 12 Yo i might be a lil bit late but on 1.20.6 you can call BuiltInRegistries.ITEMS.getTagOrEmpty(*required tag*) to get an iterable of item holders, this might be possible on 1.18.2 as well. Then you get the items using for(Holder<Item> holder: iterable) or the .forEach(Consumer<Holder<Item>>) method, or convert the iterable to array/list/collection. When you get the holders, use the .get() method to get the items Quote
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.