Jump to content

Recommended Posts

Posted

Basically what the title says. How do I place Item Frames in world gen? I can make a dozen or so blocks to get around the issue,  but I'd rather just place Item Frame entities on the wall. Is there a way to do this?

Posted

As the Item Frame is an Entity you cant place it in the World by worldgen easily but it is still accessible in Item Form with the ItemHangingEntity.class so you should be able to place one of them in the World with the given parameters.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

Oh, so you have to place it from the Entity side, cool, thanks.  While I have you here, is there an accessor method in the Entity class for placing items in the frame? I can check when I get back to my computer, but are there any tricks I should know there?

Posted

Yeah

there is a setDisplayedItem function in the Entity Class. I guess that should place an Item in there.

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

EntityItemFrame frame = new EntityItemFrame(world, x, y, z, direction);
frame.setDisplayedItem(ITEMSTACK TO DISPLAY);

Should do what you want. :D

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Posted

And then after these two lines a call to ;)

world.spawnEntityInWorld(frame);

Author of PneumaticCraft, MineChess, Minesweeper Mod and Sokoban Mod. Visit www.minemaarten.com to take a look at them.

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.