Posted May 25, 201411 yr I have a block that is essentially vines. I was wondering how to make it so that they generate in the world on the sides of trees? Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
May 25, 201411 yr I would just make a world generator for your vines, and right before the setBlock function add a test to make sure one of the blocks next to it is wood. Here's a descent tutorial on adding worldgen: http://www.minecraftforge.net/wiki/Adding_World_Generation Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more! http://i.imgur.com/ghgWmA3.jpg[/img]
May 25, 201411 yr Author I would just make a world generator for your vines, and right before the setBlock function add a test to make sure one of the blocks next to it is wood. Here's a descent tutorial on adding worldgen: http://www.minecraftforge.net/wiki/Adding_World_Generation How do i check for neighboring blocks? kind of a noob... Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
May 26, 201411 yr Author ~bump~? Legend of Zelda Mod[updated September 20th to 3.1.1] Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0] Fancy Cheeses[updated May 8th to 0.5.0]
May 26, 201411 yr Under generate, just do: boolean shouldPlace = false; if(world.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } } if(world.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.wood)/** Or whatever block **/{ shouldPlace = true; } if(shouldPlace){ world.setBlock(yourBlockName); //Or whatever function to generate the block } Keep in mind I just did this on the fly and you WILL have to modify it a bit, but you should be able to handle that... Another thing, the thing you're trying to do will be inherently laggy because it will likely have to run this code for EVERY block (or some constraint of blocks, like every block between y = 50 and y = 90 or whatever). This would apply to almost any solution for this though. (Unless you want the vines to only generate on your custom trees, in which case you could just make the vines generate as part of the tree and it would make about 8039x more sense then this ) Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more! http://i.imgur.com/ghgWmA3.jpg[/img]
May 26, 201411 yr More gratuitous cut&paste... Will this nonsense ever end? -S- (if I helped, please click Thank and applaud) http://6upnqa.dm2301.livefilestore.com/y2mtf-vG7Tqq1TiiVpIm53KWj7294NDPoHfSHHb4PzZiMAUfRCfK0UY0MwOu7Q3zTBNVTKqWjr2-xgBfFRpQT5p-QivtvknPpoABMNUw9br9WuZcBFkjePhnAbW500gVm-P/sequiturian.png[/img]
May 26, 201411 yr More gratuitous cut&paste... Will this nonsense ever end? Nope.. . --------- @chimera27, I'm pretty sure if he puts in for example: if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.leaves) It will render this vines nearly on every tree.
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.