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'm trying to create a smaller version of the vanilla Skeleton, but I've run into a couple problems that I haven't been able to work out:

[*]The location that it shoots arrows from (what I would think is the eye height) is too high.

[*]The bow it holds is too big.

[*]The bow it holds is too high up.

f6adb39378c587cff3e013ca5a90ebc1

https://gyazo.com/f6adb39378c587cff3e013ca5a90ebc1 (if the image doesn't work)

 

I looked into the EntitySkeleton class and traced the arrow it shoots back to the EntityArrow class that has this line:

 this.posY = shooter.posY + (double)shooter.getEyeHeight() - 0.10000000149011612D;

which looks like it uses eyeHeight to determine where to spawn the arrow. But .getEyeHeight() gets the height from Entity.height * 0.85F, and that height is set with .setSize(). In my own EntityBabySkeleton class, I used:

this.setSize(0.6F, 1.0F);

so the eyeHeight should be 0.85F, but it still shoots in the same location that a normal skeleton would.

(I'm sorry if that was confusing to follow)

 

As for the bow, is there a way to scale the bow's size or would I need to create a custom item with a smaller bow model? And is there a way to change where the bow appears on the model so I could move it down to the baby skeleton's hands?

For 2 & 3, you can create a subclass of LayerRenderer and do whatever transforms (e.g. scale) and translations you want to do from there. Here is an example which I use for any generic biped entity (based on the vanilla LayerHeldItem code which you should be able to use if your entity model sets isChild to true...).

 

Not too sure about #1 - it should change the position based on the shooting entity's height / eye height as you described. You may want to try playing around with the numbers and putting a break point in that EntityArrow constructor to see what, exactly, is getting passed in for your entity's eye height. You never know - it might not be what you think it is, and at the very least you will know one way or another if that truly is the issue.

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.