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 continuing (kinda) my cape topic. After discussion I've decided to make backpack instead of capes, I have backpack model that was created in blockbench and it's exported as .java class. I have two problems:

1. How to implement this model.

2. How to make void or function to render this model on player's back (also I want to make it render on players specified by UUID)

There's raw .java backpack model file (it's not in in my files yet):

// Made with Blockbench 3.8.3
// Exported for Minecraft version 1.15 - 1.16
// Paste this class into your mod and generate all required imports


public class backpack_dev extends EntityModel<Entity> {
	private final ModelRenderer bb_main;

	public backpack_dev() {
		textureWidth = 32;
		textureHeight = 32;

		bb_main = new ModelRenderer(this);
		bb_main.setRotationPoint(0.0F, 24.0F, 0.0F);
		bb_main.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -2.0F, 8.0F, 10.0F, 3.0F, 0.0F, false);
		bb_main.setTextureOffset(0, 13).addBox(-3.0F, -9.0F, 1.0F, 6.0F, 9.0F, 1.0F, 0.0F, false);
		bb_main.setTextureOffset(0, 23).addBox(-2.0F, -5.0F, 2.0F, 4.0F, 5.0F, 1.0F, 0.0F, false);
		bb_main.setTextureOffset(0, 30).addBox(-1.0F, -6.0F, 2.0F, 2.0F, 1.0F, 1.0F, 0.0F, false);
	}

	@Override
	public void setRotationAngles(Entity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
		//previously the render function, render code was moved to a method below
	}

	@Override
	public void render(MatrixStack matrixStack, IVertexBuilder buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
		bb_main.render(matrixStack, buffer, packedLight, packedOverlay);
	}

	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
}

Also I don't know why, but I get error when I paste this code into class.

Any help would be appreciated.

  • Author

I mean I want this model to be rendered always like in capes. If your UUID matches UUID in list you automatically have backpack rendered on your back.

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.