Jump to content

[1.19.3] EntityJoinLevelEvent Clientside returns Air


Crimson_Fluff

Recommended Posts

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?

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

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.

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.