Closed MWHunter closed 3 years ago
There isn't really any other method on 1.17. Usually we cache it, but if we can't cache, we need to iterate through all entities. I'll think of a fix.
I'll try something, can't guarantee it will always work, because according to you it happens rarely?
I've had it happen once. I can handle getting a null entity fine and fall back to the ZOMBIE type, as I only use bukkit entities to get the type, but getting an exception instead of no entity messes things up.
Should be fixed, try this commit https://github.com/retrooper/packetevents/commit/8f566032aaff0d67dc7dd4d2123875d087721d9f
https://gist.github.com/MWHunter/861ae64fddfda1786f76425de80f6c96
PacketEvents version: 4bbf43e
Running tuinity version: [17:49:20 INFO]: This server is running Tuinity version git-Tuinity-"6fd7e2b" (MC: 1.17.1) (Implementing API version 1.17.1-R0.1-SNAPSHOT) (Git: 6fd7e2b on HEAD)
I can't reproduce it but it occurred when a second player was logging in right next to another player already logged in. Maybe just a catch statement to get this error before trying other methods of getting the entity would work fine.