Jump to content

How to prevent server from sending entity position packets to client


thebest108

Recommended Posts

I have an entity that I spawn by the thousands, but there's a massive bottleneck because whenever the position of these entities changes it sends a packet to the client. The problem with this is that at the level of thousands sending all those packets kills any performance. I cant just set the entity to be still on the server because of tracking range and bounding boxes. Is there like a way I could tell the server to Not send any position packets for this entity?

 

The entity can handle itself on client so all these packets are useless  :(

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

Link to comment
Share on other sites

What does entity actually do? It is impossible that is can in any way "handle itself" - The rule says: "Client always lies!" - you can't expect for few clients to be handling their own entities without server.

 

Only one option is that the entities in question are PARTICLES, and particles and CLIENT SIDE - and yes - you spawn them on client, they can handle themselves and don't need server.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

No its a child entity, theres a parent entity that is receiving updates and that sets the children's positions based on where it remembers them. These dont need anything, so how can I set them to not send position packets?

"you seem to be THE best modder I've seen imo."

~spynathan

 

ლ(́◉◞౪◟◉‵ლ

Link to comment
Share on other sites

Look at:

EntityRegistry.registerModEntity(...)

 

You can set update freq to very high.

You might also want to look into PlayerEvent.StartTracking - might help somehow, but doubt it.

 

EDIT

Other than that - EntityTracker is the thing that handles tracking if given player needs to get entity's data. You can alter it with asm (might be possible wiht reflection - replace object).

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

Do these child entities need hitboxes and stuff, or are they more just a visual effect (like a something flying around a parent entity)? If it is mostly visual, then I suggest you have just one entity (the parent) and just render the others (only on the client). The parent entity would have fields to keep track of the child entities, and the server would only keep track of the parent entity. If the server needed to know or control the child entity positions, you could have a custom packet that updates them all at once.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

It really sounds like you have something acting like a particle not a full entity.  I would suggest not creating a full entity for them.  Just create a client side render mechanism.

Long time Bukkit & Forge Programmer

Happy to try and help

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.