Jump to content

Random entity texture


Recommended Posts

i have a what to you might seem like a very noob java question but i cant figure it out.

I want a system that makes a random texture, i based this on the entityid (i hope i did it correctly lol) and reduces that to 4 textures, medical0 medical1 medical2 medical3


In resourcelocation i want to combine medical with texture2 (texture 2 is an int variable) to generate ranom numbers but it just tells minecraft that the resourcelocation is medicaltexture2.png....


what did i do wrong?


	public int getMobid() {
		return mobid;
	private int texture(int number) {
		int texture2 = (mobid % 10);
		while (texture2 >= 4) {
			texture2 = (texture2 % 3);
		return texture2;

	public void registerRenderers() {
		RenderLiving customRender = new RenderLiving(Minecraft.getMinecraft().getRenderManager(), new medical.ModelNew(), 0) {
			protected ResourceLocation getEntityTexture(Entity par1Entity) {
				return new ResourceLocation("medical" + "texture2" + ".png");
		RenderingRegistry.registerEntityRenderingHandler(medical.Entitymedical.class, customRender);



Edited by alexschopbarteld
Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.