bufu1337 0 Posted October 7, 2018 Share Posted October 7, 2018 How to search for a specific Item which has a tag? for example output from crafttweaker: <"tconstruct:pick_head">.withTag({Material: "stone"}) i tried different ways with a refined storage system with only this item in it... component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", withTag={material="stone"}}) component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", Tag={material="stone"}}) component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", nbt={material="stone"}}) component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", meta={material="stone"}}) component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", material="stone"}) everything results in nil, but: component.block_refinedstorage_grid_2.getItems() finds it... but I cant use getItems() in my original system because it will result in a too long list Quote Link to post Share on other sites
0 payonel 21 Posted October 7, 2018 Share Posted October 7, 2018 the `block_refinedstorage_grid_2` component is kindly provided by refined storage: https://github.com/raoulvdberge/refinedstorage And in their integration source, they provide the `getItem` component method: https://github.com/raoulvdberge/refinedstorage/blob/mc1.12/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java#L299 I don't know how their compare methods work (you can ask them for more support) But it looks like their getItem method takes a couple extra boolean params for comparing meta and nbt. perhaps you could try `getItem({...}, true, true)` or some variation of those Quote Link to post Share on other sites
0 bufu1337 0 Posted October 7, 2018 Author Share Posted October 7, 2018 4 hours ago, payonel said: ... But it looks like their getItem method takes a couple extra boolean params for comparing meta and nbt. perhaps you could try `getItem({...}, true, true)` or some variation of those oh ups i forgot to write this in the my question of course i used `getItem({...}, true, true)` somehow refined storage compares it... because with getItems() i get a table with 'hasTag=true' Quote Link to post Share on other sites
0 bufu1337 0 Posted October 15, 2018 Author Share Posted October 15, 2018 On 10/7/2018 at 9:03 PM, payonel said: the `block_refinedstorage_grid_2` component is kindly provided by refined storage: https://github.com/raoulvdberge/refinedstorage And in their integration source, they provide the `getItem` component method: https://github.com/raoulvdberge/refinedstorage/blob/mc1.12/src/main/java/com/raoulvdberge/refinedstorage/integration/oc/EnvironmentNetwork.java#L299 I don't know how their compare methods work (you can ask them for more support) But it looks like their getItem method takes a couple extra boolean params for comparing meta and nbt. perhaps you could try `getItem({...}, true, true)` or some variation of those https://github.com/raoulvdberge/refinedstorage/issues/2028 any other suggestions here? the guys from refined storage couldnt help me out, still doesnt work to search for an item with a specific tag like in my example... Quote Link to post Share on other sites
0 payonel 21 Posted October 15, 2018 Share Posted October 15, 2018 I read what RS devs had to say about the issue, and the problem you are running into is that you are trying to make an exact match, which requires you to specify all the tags of an item. You can't omit some you don't care about. I recommend you do a more general search for items, select the one you care about, and then reuse the search result for future exact searches. Quote Link to post Share on other sites
How to search for a specific Item which has a tag?
for example output from crafttweaker: <"tconstruct:pick_head">.withTag({Material: "stone"})
i tried different ways with a refined storage system with only this item in it...
component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", withTag={material="stone"}})
component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", Tag={material="stone"}})
component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", nbt={material="stone"}})
component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", meta={material="stone"}})
component.block_refinedstorage_grid_2.getItem({name="tconstruct:pick_head", material="stone"})
everything results in nil, but:
component.block_refinedstorage_grid_2.getItems()
finds it... but I cant use getItems() in my original system because it will result in a too long list
Link to post
Share on other sites