-
-
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
Error when multiple event-values are present for a default expression #5769
Error when multiple event-values are present for a default expression #5769
Conversation
This pull request just helped me solve a Skript user's issue where
Was not working and the user didn't know why. The reasoning was because target could have been player's target or the entities target and also
Crazy how I luckily still had this pull request on my current branch as I tested their code to help them out. |
bd134d0
to
3f08853
Compare
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.
nice pr!
Description
Error when multiple event-values are present for a default expression.
This has been a common issue, where Skript silently selects the first event-value when grabbing a default expression.
For my example:
In theory Skript shouldn't know whether you want to message the egg or player in the send effect, they're both entities.
Currently Skript will send the message to whichever event-value was registered first, or placed in order of subclass. The highest subclass is always first (Skript is usually smart enough to search with converters and get the correct one just not when there is two of same type), so this will pick the egg. This is why Skript has excluded events for the event-value register method, to manually explain per event-value.
This pull request will do that automatically, as we cannot always manually adjust the error or determine when and where they collide. Also addons.
So for my example above, this will be the following error:
Notes:
on player join: -> send "Hello!"
command sender¦s
rather thanplayer¦s/console
as a command sender can now be an entity and this avoids a confusing line for EffMessage (The most likely origin of this error).Target Minecraft Versions: any
Requirements: none
Related Issues: #4787