Posted June 8, 201411 yr I wondering if anyone out there can help me with my predicament, its probably simple code and i'm just being blind. But I am trying to set a ItemStack to he previous item the player was holding before they switch to a new one. @SubscribeEvent public void onPlayerRender(RenderPlayerEvent.Specials.Post event){ if(event.isCanceled()) return; ItemStack currentHeldItem = event.entityPlayer.getCurrentEquippedItem(); ItemStack tempStk = null; ItemStack prevHeldItem = null; if(currentHeldItem != null){ tempStk = currentHeldItem; } if(tempStk != null && prevHeldItem != currentHeldItem){ prevHeldItem = tempStk; } System.out.println(prevHeldItem.getDisplayName()); if (prevHeldItem != currentHeldItem) { if ((prevHeldItem.getItem() instanceof ItemSword) || (prevHeldItem.getItem() instanceof ItemTool) || (prevHeldItem.getItem() instanceof ItemHoe)) { renderItemIn3D(prevHeldItem); } } } I need to get the currentHeldItem and set it to the prevHeld so it can be renderer when they are holding a different Item. Help would be greatly appreciated.
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.