Jump to content

JOB

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

594 profile views

JOB's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thank you, You were right i looked more deeply in the way that the inventory is generated on the GUI and found this method : renderItemIntoGUI(ItemStack stack, int x, int y) in the ItemRenderer class and it is really easy to use. For example i use it like this : public static finale Minecraft MC = Minecraft.getInstance(); MC.getItemRenderer().renderItemIntoGUI(MC.player.getHeldItemMainhand(), 200, 200); For some reasons when i first read the ItemRenderer class i completely passed over it.
  2. Resolved my issue. To get the TextureAtlasSprite of an item i use : public static final Minecraft MC = Minecraft.getInstance(); public static final PlayerEntity player = MC.player; TextureAtlasSprite texture = MC.getTextureMap().getSprite(player.getHeldItemMainHand().getItem().getRegistryName());
  3. Hello, I am currently trying to draw the texture of the current held item by the player somewhere else on the inGameGui. I am using the RenderGameOverlayEvent.post and i can easily drawString but i don't know how to draw texture. I tried using the blit method but i don't know how to get the TextureAtlasSprite of an item (wich is needed for the method). I can get the ResourceLocation of the item but i have no clue for the TextureAtlasSprite. Could i also have explanation on the bindTexture(ResourceLocation resource) method ? Thank you for any reply.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.