Jump to content

EntityPlayer to AbstractClientPlayer


Recommended Posts

Why do you need AbstractClientPlayer specifically? That is a CLIENT side only class, for one, so you'll want to check side before you check for instanceof, and the possible actual classes could be either EntityOtherPlayerMP or EntityPlayerSP... neither of which seem particularly useful.


What are you trying to do, and what have you tried?

Link to comment
Share on other sites

Allow the player to change there skin in game and to visible to every one on the server and the player's skin is defined in the AbstractClientPlayer yes EntityOtherPlayerMP or EntityPlayerSP could work but i believe the best way to go about is to use the AbstractClientPlayer.


Also the event is wired up in client proxy so is just running on the client side

Link to comment
Share on other sites

Every client-sided EntityPlayer is an instance of AbstractClientPlayer (meaning you can freerly cast it, as long as you are on client thread and do it via proxy, since it is client side class). ACP does NOT exist on server thread.


To give you wider look - click on EntityPlayer and choose "Type Hierarchy". ACP is base of all client-sided players, EntityPlayerMP for all server-sided ones.

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

Link to comment
Share on other sites

I know the skin is client size but how do i get the abstract client player from an entity player?


Use the EntityJoinWorldEvent and check the instance of the entity there compared to the AbstractClientPlayer. Then cast the event.entity to AbstractClientPlayer and do whatever you need.

Development of Plugins [2012 - 2014] Development of Mods [2012 - Current]

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.

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.

  • Create New...

Important Information

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