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

Hello, i want to create a big sword like "The Big Bertha" in orespawn but i don't know how can i create it.

If you have an idea please say me.

Thank you :)

You need to make a model and render it..

 

Some examples:

 

Put this method

    @SideOnly(Side.CLIENT)
    public boolean isFull3D() {
    	return true;
    }

to your Item class.

public class RenderEvilStaff implements IItemRenderer {

public static ResourceLocation tex = new ResourceLocation(Main.MODID, "textures/models/evilstafftexture.png");

private ModelEvilStaff staff;

public RenderEvilStaff() {
	staff = new ModelEvilStaff();
}

@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
	switch(type) {

	case EQUIPPED: return true;
	case EQUIPPED_FIRST_PERSON: return true;
	default: return false;

	}
}

@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
	return false;
}

@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
	switch(type) {



	case EQUIPPED: {
		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(tex);

		GL11.glScalef(1.4F, 1.0F, 1.4F);

		GL11.glRotatef(90, 0F, 1F, 0F);
		GL11.glRotatef(100, 1F, 0F, 0F);
		GL11.glRotatef(10, 1F, 0F, 1F);

		GL11.glTranslatef(0.06F, -1.1F, -0.45F);

		this.staff.renderModel(0.0625F);	
		GL11.glPopMatrix();
	}
	case EQUIPPED_FIRST_PERSON: {

		GL11.glPushMatrix();

		Minecraft.getMinecraft().renderEngine.bindTexture(tex);

		GL11.glScalef(1.4F, 1.0F, 1.4F);

		GL11.glRotatef(90, 0F, 1F, 0F);
		GL11.glRotatef(100, 1F, 0F, 0F);
		GL11.glRotatef(10, 1F, 0F, 1F);

		boolean isFirstPerson = false;
            if(data[1] != null && data[1] instanceof EntityPlayer) {
            	if(!((EntityPlayer)data[1] == Minecraft.getMinecraft().renderViewEntity && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && !((Minecraft.getMinecraft().currentScreen instanceof GuiInventory || Minecraft.getMinecraft().currentScreen instanceof GuiContainerCreative) && RenderManager.instance.playerViewY == 180.0F))) {
            		GL11.glTranslatef(0.06F, -1.1F, -0.45F);
            		}else{
            			isFirstPerson = true;
            			
            		}
            	}else{
            		GL11.glTranslatef(0.06F, -1.1F, -0.45F);
            		
            	}
            
            this.staff.renderModel(0.0625F);	
		GL11.glPopMatrix();

	} 		default: 
		break;	}}

 

Then render your model. (You can adjust the size and rotation and stuff with the GL11 methods.)

Well, just put this to your main class. It will run the renderer and will

render the item.

 

If you don't understand Java, please learn before copy-pasting.

And after you know the basics, try to understand the example

code I send you. It's the best way to learn how to mod/code and

customize your mod however you want.

 

	  MinecraftForgeClient.registerItemRenderer(Main.evilStaff, (IItemRenderer)new RenderEvilStaff());

 

Make sure you put this code in the init section.

no offense intended, but i think this is the easy way out since he didn't understand what the client proxy and renderer meant. updating to 1.8 seems to be the harder way out ^_^

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.