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 have an item thas a 3d item/block render for it.

If the item is in the 9th hotbar slot in 3rd person it renders on my belt.

I can see it rendering but other not.

 

EventHandler(Registered in ClientProxy)

Only the method!

 

 

@SideOnly(Side.CLIENT)

@SubscribeEvent

public void render(RenderPlayerEvent.Specials.Pre event)

{

EntityPlayer player = event.entityPlayer;

 

if (player.inventory.mainInventory[8] != null && (player.inventory.mainInventory[8].getItem() == Lantern.lanternonItem || player.inventory.mainInventory[8].getItem() == Lantern.lanternoffItem)) {

if((player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Lantern.lanternonItem || (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Lantern.lanternoffItem))){

}else{

GL11.glPushMatrix();

 

if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == Lantern.lanternonItem){

Minecraft.getMinecraft().renderEngine.bindTexture(Contants.modelTexture);

}else if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == Lantern.lanternoffItem){

Minecraft.getMinecraft().renderEngine.bindTexture(Contants.modelTexture2);

}

 

GL11.glRotatef(28F, 1.0F, 0.0F, 0.0F);

GL11.glRotatef(40F, 0.0F, 1.0F, 0.0F);

GL11.glRotatef(-15F, 0.0F, 0.0F, 1.0F);

GL11.glTranslatef(0.1F, 0.5F, -0.0F);

 

float scale = 0.55F;

GL11.glScalef(scale, scale, scale);

 

Contants.model.render(player, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

GL11.glEnable(GL11.GL_BLEND);

GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

GL11.glColor4f(1F, 1F, 1F, 0.6F);

Contants.model.renderGlass(player, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);

GL11.glDisable(GL11.GL_BLEND);

GL11.glColor4f(1f, 1f, 1f, 1f);

 

GL11.glPopMatrix();

}

}

}

 

 

 

 

Contants:

 

 

package com.fluffy.lantern.render;

 

import net.minecraft.util.ResourceLocation;

 

import com.fluffy.lantern.models.ModelLantern;

 

public class Contants {

 

public static final ResourceLocation modelTexture = new ResourceLocation("fluffy", "textures/models/LanternOn.png");

public static final ResourceLocation modelTexture2 = new ResourceLocation("fluffy", "textures/models/LanternOff.png");

 

public static final ModelLantern model = new ModelLantern();

 

}   

 

 

The server has no reason to inform other players what is in your hotbar slots. So, how are the "other" supposed to render your lantern when it's not visible to them?

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.