-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
nearest entity
expression throws stack trace when used as a LivingEntity
#6612
Comments
This is being caused because Here at Skript, our policy is to do these unchecked, unverified casts without properly checking and just suppress the warning, which is why this is occurring as a problem. The easy fix is to just make the charge effect not do that cast, since it isn't necessary, but the larger question is why the |
I feel like it might be a bit more complicated than that, since |
No, it's exactly this, and it happens with a bunch of other syntax -- I'm testing it right now to find the whole list. Basically, What probably ought to be happening is that it should sub in some kind of converted Expression that filters out the incorrect elements and returns the array that's been asked for. |
Having chased this issue down the rabbit hole, we discovered its cause is some expressions wrongly reporting their returntype as being different from the array type they return in I have a fix for this in the pipeline but I'd also like to find a way to address the more pervasive issue in future. |
- Split the properties and behaviour into their own syntax so the patterns weren't weird to accommodate for that - Changed LivingEntity to Entity to prevent ClassCastException being thrown (see issue SkriptLang#6612 and PR SkriptLang#6614)
Skript/Server Version
Bug Description
I was testing some stuff with an effect I was making and tried passing
nearest armor stand
in where%livingentities%
were accepted and it threw a stack trace (see the errors section of this). If I usetarget
instead, it works as intended.I tested with the following syntax, as well as with my own effect:
Expected Behavior
Nearest entity was supposed to work as intended. Not super sure what else to say, as I have no idea why the error is occurring.
Steps to Reproduce
This is how I reproduced it, but I imagine it works with any effect that takes
livingentities
whennearest x
is used:make (nearest creeper) charged
Errors or Screenshots
Other
Sovde and I had a chat about this which lasted a few messages here (very useless). Most of the messages are about the effect I was trying to make, but Sovde found out that, to quote, "weirdly it's only for nearest x and not nearest entity", which I think might be worth mentioning.
Agreement
The text was updated successfully, but these errors were encountered: