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

I want to make an Item the binds to a player on right-click. So far so good, I got that but now I want to render the face of the bound player on it.

Is it possible in 1.10 to render an item like this, since there is no IItemRenderer anymore?

This is probably possible with a custom model, though the asynchronous nature of skin downloading may make things tricky.

 

You'll need an

ICustomModelLoader

,

IModel

and

ItemOverridesList

for your model. I don't know of any tutorials on these, but there are several examples in Forge itself.

 

diesieben07 talks about a custom model in this thread, though it was for 1.8.9 so things are slightly different now.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

Thanks for the link.

 

But I basically want to be able to change that texture at runtime, aren't models only loaded at the start of the game, or can they change during runtime? If not, could I reload a single model?

Models can be generated on demand and cached. I suggest looking at

ModelDynBucket

, it uses an

ItemOverridesList

to generate a model with the texture of the

Fluid

contained in the bucket.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

I got the model now, but is there even any way I could render the player skin on the item, because I would need a

TextureAtlasSprite

for it.

I'm not entirely sure about that part.

 

I think the skin texture will be added to the texture atlas if you override

IModel#getTextures

to return it, you can then use the

bakedTextureGetter

argument in your override of

IModel#bake

to get the

TextureAtlasSprite

.

 

You can probably create and store an instance of

NetworkPlayerInfo

in your

IModel

's constructor, creating a

GameProfile

from the

IModel

's

UUID

. Use

NetworkPlayerInfo#getLocationSkin

to get the

ResourceLocation

of the skin texture. If you call this early (e.g. in the constructor), the skin should be downloaded in the background and may be available by the time the texture atlas is created.

 

 

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author
If you call this early (e.g. in the constructor), the skin should be downloaded in the background and may be available by the time the texture atlas is created.

 

And there lies the problem again, the texture atlas is only constructed if the whole texture manager is reloaded.

 

I think it is basically not possible to render a changing player skin on an item. It would have to be a specific skin that will not change, which is not what I want.

 

I will work on another neat effect, that isn't as complicated as this.

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.