[Tutorial] Render Scaling Up-Down for you entities with MatrixStack (make your mob bigger/smaller)

Started by minheragon12345 on Wed, 04/28/2021 - 05:48

Topic category: User side tutorials

Last seen on 14:43, 13. Jun 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[Tutorial] Render Scaling Up-Down for you entities with MatrixStack (make your mob bigger/smaller)
Wed, 04/28/2021 - 11:43 (edited)

Hey you! Yes, you! Have you ever made a model for your entity, added them to your mod, and then found out that the mob is smaller or bigger than you wanted? If true, this is WHAT you're looking for!
Sample

First of all, this is where I first reached to MatrixStack, and from that, I explore more then make this tutorial.

https://mcreator.net/forum/62190/scale-mob-code?page=0

Now let's get into it!

Step 1: You need to lock your element (of course), then choose to edit the code:
render
- If you're in 1.15, choose YourEntityEntity.java (in my case is NormalEntity.java)

- If you're in 1.16, choose YourEntityRender.java (mine is NormalRender.java)

Step 2: You'll need to scroll down and find the Render part (both 1.15 and 1.16), like this (my model is direwolf so it says Direwolf)
direwolf

Step 3: You need to replace entire thing (from "@Override" to "packedOverlay);" ) with this:
        @Override
        public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue,
                float alpha) {
            matrixStack.push();
            matrixStack.translate(0f, 1.5f - t * 1.5f, 0f);
            matrixStack.scale(xf, yf, zf);
            Direwolf.render(matrixStack, buffer, packedLight, packedOverlay);
            matrixStack.pop();

Then you'll have this:
xyzt

Step 4: Now all you need is to change the x y z t variable: (by default, originally from your model, every variable is 1)
You can see some examples from the first image from step 1, the middle one is the default, everything is 1. Any variable that is smaller than 1 makes the entity small, greater than 1 makes it bigger.
- z = front to back [The perfect example is number 1]
- x = sideway [number 2]
- y = height [number 3]

Note: when you're changing the y variable, you need to change the t variable too, change it so t = y. If not you're entity will be underground.

With that in mind: [number 4] is what I made by changing every variable to 1.5 (x=y=z=t=1.5), the entity has turned from chicken-side to wolf-side.

Another example is this, when you place a x=y=z=t=0.5 wolf next to a x=y=z=t=3 wolf. 
Sample

Personally, I really do want this to be added to Mcreator (so I won't need to lock and relock the code every time I want to edit the mobs), I photoshoped this: 
Photoshop

Edited by minheragon12345 on Wed, 04/28/2021 - 11:43
Last seen on 14:43, 13. Jun 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I fixed it, will you…
Wed, 04/28/2021 - 11:46

I fixed it, will you consider adding this to Mcreator? Having it would be so convenient.

Last seen on 09:51, 14. May 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I don't understand the…
Fri, 05/07/2021 - 19:58

I don't understand the change the x y z t variable bit. I'm not that smart but if you could show simple picture where it is that would be helpful

Last seen on 05:48, 11. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Whis matrix iAds stax? I…
Fri, 05/07/2021 - 20:36

Whis matrix iAds stax? I want to impkement a matrix stonk and how do i do do this? Sorry for english language my

Last seen on 14:43, 13. Jun 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I have the code for x y z t…
Sun, 05/09/2021 - 04:44

I have the code for x y z t in Step 3, You can just replace x, y, z, t with anynumber you want.

Last seen on 14:43, 13. Jun 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Popka983, bruh, this forum…
Sun, 05/09/2021 - 04:46

Popka983, bruh, this forum is literally how to do it

Last seen on 13:32, 13. Jun 2021
Joined Feb 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Could this be used to change…
Wed, 05/26/2021 - 13:22

Could this be used to change the baby model of the entities?

Last seen on 16:34, 31. May 2021
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I use a  geckolib animated…
Wed, 05/26/2021 - 20:02

I use a  geckolib animated model from blockbench 3.6.6 and geckolib plugin for mcreator.

But ther is no render part . Can i make it my self ? 

If so , how can i do it ?

 

Last seen on 14:43, 13. Jun 2021
Joined Jun 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You should have Render part…
Thu, 06/10/2021 - 03:55

You should have Render part in Step 1 if you're using latest version of Mcreator