Jump to content

Recommended Posts

Posted (edited)

I want to be able to render an entity in a GUI (like in the survival inventory). I found the renderEntityInInventory() method, but I can't figure out how to create and render a new entity. For reference, I am trying to recreate the armor stand like in the new smithing table GUI.

Smithing_Table_GUI_1.20.png

This is what I have so far:

  Reveal hidden contents

And before anyone tells me, I have checked InventoryScreen.class (it's where I found renderEntityInInventory()). InventoryScreen.class refers to an existing entity (the player), I am trying to instantiate and refer to a NEW entity. How can I do this or is there a better way to do it than what I think I should do? (I WOULD decompile 23w05a if mcp for snapshots was a thing.)

Edited by Hipposgrumm
Case Closed

I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?

  • Hipposgrumm changed the title to How to create new Entity in GUI?
Posted (edited)

I figured it out, I had to cast preview as LivingEntity instead of ArmorStand.

From:

private ArmorStand preview;

To:

private LivingEntity preview;
Edited by Hipposgrumm
For modders hoping for help with this themselves, this is all that had to change from my original code; line 37.

I'm not good at modding, but at least I can read a crash report (well enough). That's something, right?

  • Hipposgrumm changed the title to [Solved] How to create new Entity in GUI?

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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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