Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

The Player Logged In Event gives an player entity as part of the event, but I need it as an Abstract Client Player a cast does not work is there a where I can this.

 

Or is there another way to get player in question

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?

  • Author

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

  • Author

Skins are entirely client side. So only people who have your mod installed can see any potentially changed skin.

 

I see you point but mod allows the change of player via i wardrobe which will loaded on the server.

  • Author

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

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.

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]

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.