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

Hi ! I'm making a hat mod pretty much like iChun's hats mod, but I have trouble figuring how to render properly a hat on the player's head.

 

I want the player to pick a hat and display it on his head. Here's what I tried and the problems I've encountered:

 

  • Directly render hat's model on player during RenderPlayerEvent, it works but I've trouble syncing what hat the player picked with all the players on the map, I've considered sending packets, but I wonder how I could do that effectively. Plus the hat would render strangely when in multiplayer.
  • Spawning an entity on the player and rendering the hat model on this entity. The problem here is that when the player disconnects, the Entity may not despawn. The other problem I have is simply that the Entity won't render and I don't know why (I've correctly setup a renderer for my entity). Plus I'm afraid spawning an entity for every hat could cause some lag issues, .

 

I took a look at iChun's code on github, it seems like it spawns entities on the player, but I can't figure out how to do that correctly.

 

If anyone has any idea :)

Catching the part where the player disconnects is quite easy, just catch the playerloggedout-event and kill the entity there

are you registering the renderer? maybe thats bc its not rendering

Can't you just extend helmets to make hats? Just treat them like custom cloth (leather) helmets, and even let them offer that small bit of protection (and apply a few enchantments).

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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.