Posted July 28, 201312 yr 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?
July 28, 201312 yr 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.
July 28, 201312 yr new EntityItemFrame(world, x, y, z, direction) PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.
July 28, 201312 yr Author 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?
July 28, 201312 yr 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.
July 28, 201312 yr EntityItemFrame frame = new EntityItemFrame(world, x, y, z, direction); frame.setDisplayedItem(ITEMSTACK TO DISPLAY); Should do what you want. PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.
July 30, 201312 yr 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.