[Suggestion] Add datapack tags support for items, entity types and blocks with query().
TCasseBloc opened this issue ยท 5 comments
From the discussion at https://discordapp.com/channels/211786369951989762/573613501164159016/732999033089687665.
Suggestion to add query(block, 'block_tag', 'namespace:tag')
, query(item, 'item_tag', 'namespace:tag')
and query(entity, 'entity_tag', 'namespace:tag')
for the minecraft API, testing for datapack-defined tags in Scarpet.
Links to gnembon/scarpet#80
This could simplify a lot of code related to testing if you can break some block with some tool. Instead of having to test for every single block individually and return the corresponding tool type, as well as testing for every valid tool and returning its type, you could define those lists as tags in a datapack, and then test for example if the block matches the mined_with:pickaxe
block tag and that the tool you're holding matches the fabric:pickaxes
item tag. This would save several hundred lines of code from within the Scarpet app itself as well as make things more modular by allowing multiple Scarpet apps (and other stuff) to take advantage of these tags.
You really are dedicated to that right tool for block app aren't you, @James103 ? I mean, I appreciate it as a cool idea, it's just sorta funny as well that you've been pushing for this since before the lockdown.
ok, so there are 4 tag thingys as of 1.16 - blocks, items, fluids and entity types. blocks and items are fully covered with block_list, block_tags, item_list and item_tags. Entity tags are covered via tag selectors and appropriate options for query and modify. Won't be touching liquid tags since its a waste of time (lava and water, duh).