-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Indices of X in List #7323
base: dev/feature
Are you sure you want to change the base?
Add Indices of X in List #7323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nois
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have forgotten that ExprIndexOf already exists. This needs to be merged with that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My very important review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks good
Description
This PR aims to add an expression to get the indices or positions of a list where the value at that index is the provided value.
The indices option is only allowed for variable lists, which returns strings. Whereas for positions it returns an integer. You can get the position of any list. For example:
This expression was merged with the current ExprIndexOf, which I renamed for clarity. The default, if you do not specify last or all is the first index/position. This is done to be consistent with the old ExprIndexOf.
Target Minecraft Versions: any
Requirements: none
Related Issues: #3933