-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
NPE from setting variable to drops & ClassCastException: CreatureSpawnEvent > ProjectileLaunchEvent #4350
Comments
Send the code block that caused that error and try to update skript to beta3 As for the |
MY BAD! I thought I was on the latest version, downloaded it but apparently didn't verify it uploaded properly. After updating I confirmed that these errors are still present. Here is the log file of the server. Here is the script I used to reproduce these errors. The NPE is quite hard to reproduce, I had to spawn hundreds of skeletons that used the equipment given by this script and kill them all with sweeping edge. It may be because of something they spawned with. |
The CCE is probably a duplicate of #3499. The NPE can be fixed by adding a Objects::nonNull to the stream in ExprDrops (even though I don't know why the list contains a null value in the first place) (low prio because a null value in the drops list is probably some plugin's mistake) |
Actually I am going to close this, because the remaining issue (the NPE) is a plugin issue (or maybe server issue), because I don't think the drops list in a death event should contain null values, and looking at your script and the exception, it looks like the event was called with the null value in the list (or added to it before the event was passed to Skript) |
Skript/Server Version
Bug Description
NullPointerException
This error occurs very infrequently, I can't find any rhyme or reason for it. It seems to be because I have modified load outs of various mobs when they spawn. I also have the loot reduced by 50%, one of these things is likely causing it to fail.
Error here
ClassCastException
This one happens quite frequently when spawning a bunch of mobs with a command block. Seems to be from setting the off hand tool of a mob.
Error here
Expected Behavior
NullPointerException
When this error occurs, the variable never gets set to the drops which can cause issues.
ClassCastException
Unlikely to happen in regular use, but it still happened and probably shouldn't.
Steps to Reproduce
NullPointerException
Honestly can't tell you for sure. I believe it's partially because I modified the armor and tools of the mobs when they spawned and have the drops modified when they die. I can't seem to get this to happen without those two things. Even with those things, it's very inconsistent.
ClassCastException
Seems to be caused by setting the off hand tool of a mob when it spawns, then spawning a boat load of said mob.
Errors or Screenshots
No response
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: