Posted June 13, 20178 yr Hi, I have an Animal that grows with a smooth animation (meaning it grows continuously until it reaches adult size). It has a value for its age, and I now want to be able to have a dynamic hitbox, meaning that the animal grows together with the render scale. How would I accomplish such a thing? Edited June 18, 20178 yr by Tschipp
June 20, 20178 yr What I did was to just put Entity#setSize([width of grown animal] * [a factor that goes from the smallest size* when it's a baby, up to 1 when it's an adult], [height of grown animal] * [the same factor]); in EntityLivingBase#onLivingUpdate. In order to calculate the factor I would need to see your code for handling aging, unless you could figure it out yourself? *By the smallest size I mean say if the smallest version of the animal was 20% the size of the adult one, the "smallest size" would be 0.2, if it was 10% it would be 0.1 etc. IGN: matte006 Played Minecraft since summer 2011. Modding is my life now. Please check out my mod https://minecraft.curseforge.com/projects/gadgets-n-goodies-mod?gameCategorySlug=mc-mods&projectID=230028
June 25, 20178 yr Author On 20.6.2017 at 2:43 PM, TheMattyBoy said: What I did was to just put Entity#setSize([width of grown animal] * [a factor that goes from the smallest size* when it's a baby, up to 1 when it's an adult], [height of grown animal] * [the same factor]); in EntityLivingBase#onLivingUpdate. In order to calculate the factor I would need to see your code for handling aging, unless you could figure it out yourself? *By the smallest size I mean say if the smallest version of the animal was 20% the size of the adult one, the "smallest size" would be 0.2, if it was 10% it would be 0.1 etc. Thanks, gonna try that
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.