Crimson_Fluff Posted January 20, 2023 Share Posted January 20, 2023 Hello All, Using the EntityJoinLevelEvent event, checking for Item Entities. When an item entity spawns in I notice that Client-side 'Air' is always returned, whereas Server-side the correct item is returned I feel this is a bug... Quote Link to comment Share on other sites More sharing options...
warjort Posted January 20, 2023 Share Posted January 20, 2023 Your issue is not something I know a lot about, but I would guess your problem is related to how minecraft sends entity data to the client. If you look at ServerEntity.sendPairingData() it sends multiple network packets for each entity. Relevant to your use case are the first 2 packets: ClientboundAddEntityPacket ClientboundSetEntityDataPacket The first packet will lead to that event being called, but the itemstack inside an ItemEntity is sent in the 2nd packet. Until the 2nd packet arrives, the entity will have default values, in your case that is ItemStack.EMPTY (air) There is no guarantee when the 2nd packet will arrive. Interestingly, Mojang added a new feature to client bound network packets in the latest snapshot https://www.minecraft.net/en-us/article/minecraft-snapshot-23w03a Quote PACKET BUNDLES Added new delimiter packet to clientbound game protocol All packets between two delimiters are guaranteed to be processed within same tick I don't know whether they applied this new feature to entity spawns? Quote Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post. Link to comment Share on other sites More sharing options...
Crimson_Fluff Posted January 20, 2023 Author Share Posted January 20, 2023 hoping its something Forge can fix. As this seems wrong to get two different results. Im wondering if previous Forge versions do the same. I might have to do some testing Its not really important, I do my work Server side, its just something I noticed Quote Link to comment Share on other sites More sharing options...
warjort Posted January 20, 2023 Share Posted January 20, 2023 I had a look at the 23w03a code and entity spawns packets ARE sent together in the new ClientboundBundlePacket. It's not clear to me whether it will help with that event, but it will mean any entity tick processing will see a consistent view of the entity in the future. Quote Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.