Replies: 1 comment
-
could you add #1220 `s trigger event part? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, there appears to be not enough Scarpet API functionality to re-implement the
/advancement
command and to allow testing that a player has an advancement (or a specific criteria thereof).To fix this, I would like to propose the following functions:
Functions
advancements()
Lists all advancements there are in the game.
advancements(advancement, 'criteria')
Lists all criteria associated with a specific advancement.
advancements(advancement, 'parent')
Returns the parent of the advancement, or
null
if the advancement is a root advancement.advancements(advancement, 'children')
Lists all children that a specific advancement has.
query(e, 'advancement', advancement)
Returns whether the given player has completed the advancement in full.
If
e
is not a player, returnsnull
.query(e, 'advancement', advancement, criteria)
Returns whether the given player has completed the given criteria.
If
e
is not a player, returnsnull
.modify(e, 'advancement', advancement, complete)
Grants (
complete = true
) or revokes (complete = false
) the advancement in full.If
e
is not a player, returnsnull
.modify(e, 'advancement', advancement, criteria, complete)
Grants (
complete = true
) or revokes (complete = false
) the given criteria.If
e
is not a player, returnsnull
.Examples
/advancement grant @a everything
:for(advancements(), a = _; for(player('all'), modify(_, 'advancement', a, true)))
/advancement revoke @a everything
:for(advancements(), a = _; for(player('all'), modify(_, 'advancement', a, false)))
Get the number of players who have killed at least one mob:
for(player('all'), query(_, 'advancement', 'minecraft:adventure/kill_a_mob'))
List out which advancements you can still complete:
for(advancements(), if(!query(p, 'advancement', _), print(_)))
Find out which items you have acquired a stack of during your lifetime.
for(advancements('blazeandcave:challenges/stack_all_the_items', 'criteria'), if(query(p, 'advancement', _), print(_)))
Beta Was this translation helpful? Give feedback.
All reactions