Jump to content

Colored Glowing Effect on ItemStacks (on Ground)


Recommended Posts


I am trying to create a Mod which can show "Ghost-Items" in the world and cover them with a colored glowing effect. NOTICE: clientside only!


Here you can see how the "Ghost-Items" are generated: 


ghostEntity = new EntityItem(mc.player.getEntityWorld(), 0, 70, 0, new ItemStack(Blocks.COBBLESTONE));


To render the Ghost-Items, I created a custom renderer which can render the Ghost-Item at a specific location in the world: (based on RenderEntityItem.class)


public void doRender(EntityItem entity, double xPos, double yPos, double zPos, float entityYaw, float partialTicks) {
		ItemStack itemstack = entity.getItem();
		// Noetig damit Item keine Defaulttextur bekommt

		GlStateManager.alphaFunc(516, 0.1F);
		GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
		IBakedModel ibakedmodel = itemRenderer.getItemModelWithOverrides(itemstack, entity.world, (EntityLivingBase) null);
		boolean forceGlowing = true;
		if (forceGlowing) { // FORCE ENTITY GLOWING
		Minecraft mc = Minecraft.getMinecraft();
		float playerX = (float) (mc.player.lastTickPosX + (mc.player.posX - mc.player.lastTickPosX) * partialTicks);
		float playerY = (float) (mc.player.lastTickPosY + (mc.player.posY - mc.player.lastTickPosY) * partialTicks);
		float playerZ = (float) (mc.player.lastTickPosZ + (mc.player.posZ - mc.player.lastTickPosZ) * partialTicks);

		float dx = (float) (xPos - playerX);
		float dy = (float) (yPos - playerY);
		float dz = (float) (zPos - playerZ);
		GlStateManager.translate(dx, dy, dz);

		// Groesse aendern! wenn auskommentiert, wird voller Block gerendert
		// Item Rendern
		itemRenderer.renderItem(itemstack, ibakedmodel);
		if (forceGlowing) { // FORCE ENTITY GLOWING


To add the colored glowing effect, I created a custom team and added the Ghost-Item


			Scoreboard scoreboard = mc.player.getWorldScoreboard();
			if(scoreboard != null){
				if(scoreboard.getTeam("Test1") == null){
					System.out.println("create Team");
					ghostEntity = new EntityItem(mc.player.getEntityWorld(), 0, 70, 0, new ItemStack(Blocks.COBBLESTONE));
					scoreboard.addPlayerToTeam(ghostEntity.getCachedUniqueIdString(), "Test1");


The problem is, that if the glowing effect is enabled, the whole Ghost-Item is rendered white.


Picture 1: Ghost-Item at a specific location in the world without glowing effect: CLICK


Picture 2: Ghost-Item at a specific location in the world with glowing effect: CLICK


How can I fix this? The teamcolor is e.g GOLD.


Thank you for your help.















Edited by badner
  • Like 1
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.