Posted October 8, 20195 yr Hello, so I'm trying to add additional tooltips to items. I have it so that when you press a character, it will do something to a item. I want to be able to see that the item has been modified. I am using RenderTooltipEvent.PostBackRound, but it just keeps crashing. Here is my code: @SubscribeEvent public static void onTooltipPreEvent(RenderTooltipEvent.PostBackground event) { ItemStack stack = event.getStack(); NBTTagCompound nbt; if (stack.hasTagCompound()) { nbt = stack.getTagCompound(); } else { nbt = new NBTTagCompound(); } if (nbt.hasKey(ModifactionTable.NBT_LOCK)) { if (nbt.getBoolean(ModifactionTable.NBT_LOCK)) { event.getLines().add("Item Modified"); } } } Edited October 8, 20195 yr by TesterTesting135 Solved
February 11, 20205 yr 1 hour ago, diesieben07 said: 编写自己的线程,发布代码和遇到的问题。 @SubscribeEvent public void event(RenderTooltipEvent.Pre event){ Minecraft mc = Minecraft.getInstance(); event.setCanceled(true); mc.getTextureManager().bindTexture(ITEMGUI); this.blit(event.getX(),event.getY(),0,0,109,158); } Rendering problems, how should be solved?
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.