Add ItemStack trigger for entry unlock
ejektaflex opened this issue ยท 3 comments
It would be nice to be able to unlock page entries upon pickup or craft of an item, instead of advancement unlocking. The reasoning behind this is that while modpack makers are welcome to make their own books, modpack makers have very little control over when the content gets unlocked. The only triggers they can watch for are advancements, which are rather cumbersome to make.
This is a suggested user implementation:
Instead of "advancement": "mymod:myadv"
, you could have "item": "mymod:myitem"
. Picking up that item / having the item in your inventory would unlock the entry for the player. Since the page would be permanently unlocked once the item was picked up, it would be beneficial to keep track of this data via capabilities (as you don't have advancements to watch to keep track of which entries are locked). The ability to restrict a page to be unlocked upon crafting an item in a crafting table would also be incredibly useful!
I hope this is sensible. This would be a great step forward for modpack makers.
oh, fyi i wrote a mod so that you can load custom advancements, loot tables, etc. across saves. https://github.com/liachmodded/datapacks
{ "criteria": { "0": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [{
"item": "twilightforest:crumble_horn"
}]}}}}
Just copy and paste? ๐ค
No descriptor, no parent, no display group. Just this will work by itself. If you do this, it will stay hidden even when unlocked.
This works, better than my suggestion as it then only keeps track of advancements. On the flip side, though, aren't these custom advancements per-world? You'd have to create your custom advancements then with something such as "Triumph" in order to persist across worlds and exist in a new world. Unless I'm missing something, that's what I'm understanding at least.