Posted August 17, 201411 yr How do I get an entities ID client side? I'm trying to send a packet to the server to find the server side copy of the entity to get info from for the client side entity, but I can't figure out how to get the integer ID from the client side entity. Any ideas?
August 18, 201411 yr entity.getEntityId(), but what kind of info are you trying to get, and why do you need to send a packet from the client to the server? If it's your entity, you should either implement IEntityAdditionalSpawnData to get the extra data to the client when the entity spawns, or use DataWatcher or packets to keep whatever fields you are watching up-to-date on the client. http://i.imgur.com/NdrFdld.png[/img]
August 20, 201411 yr Author entity.getEntityId(), but what kind of info are you trying to get, and why do you need to send a packet from the client to the server? If it's your entity, you should either implement IEntityAdditionalSpawnData to get the extra data to the client when the entity spawns, or use DataWatcher or packets to keep whatever fields you are watching up-to-date on the client. So the entity is basically a snowball (I copied the Throwable entity class and changed a few values to change how it flew). The throwable entity class has a Thrower value on it to track the entity that threw it, this is built into the vanilla throwable entity class too. I'm trying to do some calculations based on the thrower, yet, the client version of the entity doesn't register the thrower, only the server side entity does. Because of this, I keep getting null pointer exceptions! Would one of your suggestions help fix that?
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.